One-click draft blog post in Github (for Eleventy)
In Github, you can create new files via a url link, and thus we can create new blog posts easily in Eleventy.
For a draft post, you will need these two keys and values in the front matter:
--- eleventyExcludeFromCollections: true permalink: false ---
The format for creating a new file is thus:
Substitute the upper-case values accordingly.
To fill in
SOME_VALUE with the front matter needed for a draft blog post, we have to URI encode this:
--- eleventyExcludeFromCollections: true permalink: false title: your title here --- Your draft text here.
Use the encodeURI function to encode the text. Then take this value and substitute
SOME_VALUE with it, construct the url, then save it as a bookmark.
You can even assign a hotkey for it, see this method.