-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sites-29416)!: Add support for importing non-image assets #7
Conversation
We should use lower case for the asset folder names, since in AEM DAM paths are case-sensitive; AEM automatically generates a JCR node name that is lowercased, so reference paths should also use lower case.
This reverts commit cdc8b74.
@@ -10,9 +10,9 @@ | |||
* governing permissions and limitations under the License. | |||
*/ | |||
import { createJcrPackage } from './package/packaging.js'; | |||
import { getImageUrlsFromMarkdown } from './package/image-mapping.js'; | |||
import { getAssetUrlsFromMarkdown } from './package/asset-mapping.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires a full version bump when releasing!
@@ -18,6 +18,9 @@ const imageRegex = /!\[([^\]]*)]\(([^) "]+)(?: *"([^"]*)")?\)|!\[([^\]]*)]\[([^\ | |||
// Regex for reference definitions | |||
const referenceRegex = /\[([^\]]+)]:\s*(\S+)/g; | |||
|
|||
// Regex for non-image asset links (PDFs, docs, excel etc.) | |||
const nonImageAssetRegex = /(?:\[(.*?)\]|\[.*?\])\(([^)]+\.(?:pdf|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|rtf|txt|csv))\)|\[(.*?)\]:\s*(\S+\.(?:pdf|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|rtf|txt|csv))/gi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a unit test to validate that we are catching the different types of assets.
# [2.0.0](v1.1.2...v2.0.0) (2025-02-26) * feat(sites-29416)!: Add support for importing non-image assets ([#7](#7)) ([ef4b444](ef4b444)) ### BREAKING CHANGES * The API getImageUrlsFromMarkdown has been renamed to getAssetUrlsFromMarkdown, to align more accurately to what it is doing. Co-authored-by: Ben Helleman <bhellema@adobe.com>
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Enhance the importer to also import non-image assets that are linked in the page : pdf | doc | excel | videos
SITES-29416
Motivation and Context
To allow users to import all type of assets to AEM for Crosswalk use case.
BREAKING CHANGE: The API getImageUrlsFromMarkdown has been renamed to getAssetUrlsFromMarkdown, to align more accurately to what it is doing.