StackEdit supports a YAML metadata block at the post top to set a few flags. Pandoc does too, and I wonder if their usage conflicts.
Since the last experiment caused WordPress to show the YAML in the body of the post, here’s a new try. This time we are publishing with a custom template:
<%= strippedDocumentMarkdown %> (include boilerplate text too)
As before, the YAML is setting a collection of variables, some of which are not actually supported by StackEdit which I’d hope would simply be ignored.
--- title: Yet Another StackEdit Test with YAML layout: Aside published: false tags: [Markdown, HTML, YAML] category: Experiment ---
Written with StackEdit.
(include boilerplate text too)
Update on site
The post indeed had tags
and title
set, and landed as a draft as specified by published
. As expected, layout
and category
were ignored. As a record of my continuing experiment with StackEdit, I will likely set the Format to Aside manually, as well as actually publish the Draft.
The templates in StackEdit are implemented by underscore. Apparently the template engine didn’t like my placing what could have been a template into the post body, as it went missing. I’ve manually replaced it for this post. Due to the other known bugs with Markdown indented code blocks, I’ve also switch to fenced blocks which at least display the “ characters intact.
The ability to drop some boilerplate text onto the post is interesting, and might be useful if the setting sticks in StackEdit to use to always drop a copyright notice, link to our main site, or some other text into each post on its way to WordPress.
Hi, I just don’t understand where to place that template code and what effect does it have on metadata (date, tags, status)…
If “publish” is set to Markdown, shortcodes will work on WP.com but YAML header won’t.
If “publish” is set to HTML, shortcodes won’t render but YAML is parsed (tags and status).
How are you dealing with this?
LikeLike
I set the template in StackEdit, by picking “Custom Template” when I used the Publish menu. That is, I clicked Menu, Publish, WordPress. Then in the dialog box under Format I picked Template, then checked the box labeled Custom Template and filled it in with the template quoted above.
The title, tags, and published variables set in the YAML block were handled when posting.
I would like to see the category and layout variables handled as well, but can live without them as long is it is possible post a draft.
I haven’t tried any shortcodes at all yet in any format. I probably should play with that next.
LikeLiked by 1 person
You’re a life saver! Thanks.
LikeLike