Merge pull request 'feat: Download picture on array keys' (#5) from picture_download into main
## Détails - permet de télécharger les images depuis directus qui sont contenu dans un array ## Pourquoi Pour faciliter l'import d'images Reviewed-on: https://git.weko.io/resilien/directus-to-markdown/pulls/5
This commit is contained in:
commit
869c4f82c1
4
index.js
4
index.js
|
@ -53,6 +53,10 @@ export default class DirectusToMarkdown {
|
|||
if (typeof uuid === 'string' && uuid.match(uuidregex)) {
|
||||
const filename = await this._downloadAsset(uuid, itemPath)
|
||||
item[key] = filename // Update field with filename instead of uuid
|
||||
} else if (Array.isArray(uuid)) {
|
||||
for (const element of uuid) {
|
||||
await this._downloadAssets(element, itemPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@resilien/directus-to-markdown",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"description": "Export Directus items to markdown files with assets",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"license": "ISC",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@directus/sdk": "^9.5.2",
|
||||
"@directus/sdk": "^9.9.1",
|
||||
"js-yaml": "^4.1.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue