Also note, I have a blank variable for summary. Since I’m using webmentions, I use the summary as the text for a tweet, which would be different than an excerpt. Some of this may change when I redo the site redesign, but for now, it’s how I roll.
var title = '%filltext:name=Title%'; slug = title.replace(/[^\w\s]/gi, ''); var newslug = title.split(" ").join("-"); var dt = new Date(); TextExpander.appendOutput("---\n"); TextExpander.appendOutput("layout: post \n"); TextExpander.appendOutput("title: " + '"' +title + '"'+ "\n"); TextExpander.appendOutput("tags: \n"); TextExpander.appendOutput("published: true \n"); TextExpander.appendOutput("permalink: ") +TextExpander.appendOutput(newslug.toLowerCase()); + TextExpander.appendOutput(" \n"); TextExpander.appendOutput("date: ") + TextExpander.appendOutput(dt.getFullYear() + "-" +(dt.getMonth() +1) + "-" + dt.getDate()) + TextExpander.appendOutput("\n"); TextExpander.appendOutput("summary: \n"); TextExpander.appendOutput("--- \n"); // %filltop%
Got Something To Say?