-
Hi @estruyf, How could I automate this process going forward, for new content? I guess I could update the The only manual step would be to take each of the new files that get created and convert it to a page bundle with either a default image or a custom image for that piece of content. Do you think that could be automated with a custom script which could get triggered whenever a new content is created? I haven't looked at that option much, but just wondering if it you think it is possible and worth more exploration. Also, FYI, here is the Congo discussion with @jpanther where we are talking about the new feature. Thanks for all your guidance and support! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Going through the documentation, I found content types, fields, and placeholders which allows me to do something like this: "frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"pageBundle": false,
"previewPath": null,
"template": "[[workspace]]/.frontmatter/templates/default.md",
"fields": [ ... ]
},
{
"name": "bundle with thumbnail",
"pageBundle": true,
"previewPath": null,
"template": "[[workspace]]/.frontmatter/templates/default.md",
"fields": [
...
{
"title": "Content preview",
"name": "preview",
"type": "image",
"isPreviewImage": true,
"default": "thumbnail.png"
},
...
]
},
{
"name": "bundle with feature image",
"pageBundle": true,
"previewPath": null,
"template": "[[workspace]]/.frontmatter/templates/default.md",
"fields": [
...
{
"title": "Content preview",
"name": "preview",
"type": "image",
"isPreviewImage": true,
"default": "feature.png"
},
...
]
}
], Then I can choose the type when creating the content, and have it create as a pagebundle as well as auto populate the That gets me very far! The only part that is missing is auto adding some default image, maybe as part of a postScript with a custom bash script. What I've tried so far: ...
"frontMatter.taxonomy.contentTypes": [
...
{
"name": "bundle with thumbnail",
"pageBundle": true,
"previewPath": null,
"template": "[[workspace]]/.frontmatter/templates/default.md",
"postScript": "copyLion-shell",
"fields": [ ... ]
},
...
],
...
"frontMatter.custom.scripts": [
{
"id": "copyLion-shell",
"title": "Copy Lion via shell",
"script": "./scripts/copy_lion.sh",
"command": "/bin/bash",
"type": "content",
"bulk": false,
"output": "notification",
"outputType": "text",
"hidden": false
},
] contents of #!/bin/bash
echo "workspaceArg: $1"
echo "fileArg: $2"
echo "frontMatterArg: $3"
cp $1/assets/img/bw_lion.png $1/$2/thumbnail.png But I'm getting some @estruyf any thoughts on what might be causing the |
Beta Was this translation helpful? Give feedback.
Going through the documentation, I found content types, fields, and placeholders which allows me to do something like this: