feat: Download picture on array keys
This commit is contained in:
parent
7d96eb23a6
commit
4e11f4a3c7
4
index.js
4
index.js
|
@ -53,6 +53,10 @@ export default class DirectusToMarkdown {
|
||||||
if (typeof uuid === 'string' && uuid.match(uuidregex)) {
|
if (typeof uuid === 'string' && uuid.match(uuidregex)) {
|
||||||
const filename = await this._downloadAsset(uuid, itemPath)
|
const filename = await this._downloadAsset(uuid, itemPath)
|
||||||
item[key] = filename // Update field with filename instead of uuid
|
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",
|
"name": "@resilien/directus-to-markdown",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Export Directus items to markdown files with assets",
|
"description": "Export Directus items to markdown files with assets",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@directus/sdk": "^9.5.2",
|
"@directus/sdk": "^9.9.1",
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue