Jekyll Front Matter
Shared by @jordanmerrick
Insert Jekyll Front Matter
Script
// get filename
var filename = editor.getFileName().slice(0,-4);
// set datetime
var today = new Date();
var date = today.toJSON().slice(0,10);
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var datetime = "date: " + date + " " + time;
// set title for Jekyll front matter
var title = "title: \"" + filename + "\""
// set front matter
var frontMatter = "---\n" + title + "\n" + datetime + "\n---\n"
editor.replaceTextInRange(0, 0, frontMatter);