pawelgrzybek / snippet-generator

Snippet generator for Visual Studio Code, Sublime Text and Atom
https://snippet-generator.app/
1.74k stars 202 forks source link

How to add current date/time in iso format? #39

Closed amitpatelx closed 4 years ago

amitpatelx commented 4 years ago

I use sublime for editing markdown files of jekyll backed blog. I need to insert front matter frequently. for example

---
layout: post
title:  
author: 
date:   2019-11-11
---
pawelgrzybek commented 4 years ago

Hi.

I use something very similar in my hugo set-up. Take this one and edit it to your needs.

"Blog - new post": {
  "prefix": "blog-newpost",
  "body": [
    "---",
    "title: \"${1:Title}\"",
    "description: \"${2:Description}\"",
    "photo: ${3:$CURRENT_YEAR}-${4:$CURRENT_MONTH}-${5:$CURRENT_DATE}.jpg",
    "draft: true",
    "---"
  ],
  "description": "Blog - new post"
},

Thanks for using my app and have a great day 🥑