I would add a complete "hook system" where we can reference scripts on several activities/events, but post-creation comes to mind first.
I would add a complete "hook system" where we can reference scripts on several activities/events, but post-creation comes to mind first.
<!-- github-comment-id:1196616158 -->
I have a specific use case in mind: I have a content type that is basically a youtube video. When creating that post I would want to retrieve that videos thumbnail as a preview image to be saved next to the markdown file of the content. Currently I am doing that via creating the content > manual action with frontmatter button.
I would think that is what this feature might be about?
I have a specific use case in mind: I have a content type that is basically a youtube video. When creating that post I would want to retrieve that videos thumbnail as a preview image to be saved next to the markdown file of the content. Currently I am doing that via creating the content > manual action with frontmatter button.
I would think that is what this feature might be about?
<!-- github-comment-id:1198262668 -->
@davidsneighbour correct, that is my use case as well.
The postscript functionality is now available in the latest beta.
Here is what you need to do:
Create a script
The postscript functionality uses the content scripts from the frontMatter.custom.scripts settings. All you have to do is add a new id property to the script.
{"frontMatter.custom.scripts":[{"id":"generate-social-image","title":"Generate social image","script":"./scripts/social-img.js",}}
Info: If you want to hide the script/action from the UI, you can add a property hidden and set it to true.
Define the postscript in the content type
The content type has a new property called: postScript, which requires the id of the script to execute.
@davidsneighbour correct, that is my use case as well.
The postscript functionality is now available in the latest beta.
Here is what you need to do:
**Create a script**
The postscript functionality uses the content scripts from the `frontMatter.custom.scripts` settings. All you have to do is add a new `id` property to the script.
```json
{
"frontMatter.custom.scripts": [
{
"id": "generate-social-image",
"title": "Generate social image",
"script": "./scripts/social-img.js",
}
}
```
> **Info**: If you want to hide the script/action from the UI, you can add a property `hidden` and set it to `true`.
**Define the postscript in the content type**
The content type has a new property called: `postScript`, which requires the `id` of the script to execute.
<!-- github-comment-id:1205259002 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Add the ability to reference a script that will be executed after content creation happened.
I would add a complete "hook system" where we can reference scripts on several activities/events, but post-creation comes to mind first.
I have a specific use case in mind: I have a content type that is basically a youtube video. When creating that post I would want to retrieve that videos thumbnail as a preview image to be saved next to the markdown file of the content. Currently I am doing that via creating the content > manual action with frontmatter button.
I would think that is what this feature might be about?
@davidsneighbour correct, that is my use case as well.
The postscript functionality is now available in the latest beta.
Here is what you need to do:
Create a script
The postscript functionality uses the content scripts from the
frontMatter.custom.scriptssettings. All you have to do is add a newidproperty to the script.Define the postscript in the content type
The content type has a new property called:
postScript, which requires theidof the script to execute.