estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.97k stars 79 forks source link

Examples for custom.scripts #39

Closed xunhs closed 3 years ago

xunhs commented 3 years ago

Hi, thanks for your great extension for Hugo user. I have a little problem when design a custom action. Would you please provide some codes / examples for frontMatter.custom.scripts? Thanks very much~

estruyf commented 3 years ago

On the readme, there was a sample provided. I have updated this one, hope it makes it a bit clearer. The script itself can also be found here: https://github.com/estruyf/vscode-front-matter/blob/master/sample/script-sample.js

Let me know if you have any other questions about it.

xunhs commented 3 years ago

On the readme, there was a sample provided. I have updated this one, hope it makes it a bit clearer. The script itself can also be found here: https://github.com/estruyf/vscode-front-matter/blob/master/sample/script-sample.js

Let me know if you have any other questions about it.

Thank you very much for your kindly reply~ That is a great toturial example for a beginer like me. Actually, I want to active an action which can add a shortcode by only an action click on the panel. Anyway, I am going to read your source codes and have a try to achieve it.

Best Regards

estruyf commented 3 years ago

Going to close this issue. Feel free to let me know if more details are required.

Also wrote an article about how I use it to generate my blog its preview images: https://www.eliostruyf.com/generate-open-graph-preview-image-code-front-matter/