HTML/JavaScript form that saves user input into a text file in Markdown format with YAML front matter for use on your local computer. Use to quickly create a post for publishing with a static website generator such as Hugo or Jekyll. Based on this code.
To use it yourself:
- Download and save index.html to your desktop or any location on your computer.
- If you like, edit the file to add your own front matter fields. This involves modifying the JavaScript and HTML code and comments indicating these fields are present.
- Open
index.html
locally with your web browser fill in the form fields and click Save To File. You can also put the file on your web server so you can access it from any computer.
I have naively tested the script on Firefox on Mac OS.
The script also works on Chrome, but the autocomplete doesn't seem to work unless the form fields are wrapped in form tags with the autocomplete attribute (<form autocomplete="on">…</form>
), and when I do this the entire form disappears in Firefox. I'm still investigating, and if you have any tips, I'm all ears and appreciate pull requests.
- Live Markdown preview.