Fork me on GitHub


Front Matter snippet for Sublime Text in Metalsmith post

I made a quick snippet to add the Front Matter to Metalsmith blog posts, using the Sublime Text Unofficial Documentation and this handy reference for defining scope in Sublime. This is my result:

title: $1 
date: ${2:2017-04-01}
layout: post.hbs
collections: posts
draft: true

  <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
  <!-- Optional: Set a scope to limit where the snippet will trigger -->

Tab to move between title, date and the beginning of the post.

Type fm then hit the tab key to expand.

It would be nice to insert the date with a keystroke. There’s a plugin for that, maybe tomorrow…