From 6d9b32233ba24c98e972c0469c4811679f6c6ccf Mon Sep 17 00:00:00 2001 From: Dhananjay Balan Date: Mon, 28 Jan 2019 17:23:15 -0500 Subject: [PATCH] Update new post script for new tagging format --- new_post.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/new_post.py b/new_post.py index e61f8fa..0c5a88d 100755 --- a/new_post.py +++ b/new_post.py @@ -1,6 +1,5 @@ -#!/usr/bin/env python +#!/usr/local/bin/python3 import datetime -import yaml blog_title = input('title for the entry: ') title_date = input('date for the entry (format:yyyy-mm-dd|defaults to today): ') @@ -20,16 +19,14 @@ layout: post title: "go: `:=` operator causes accidental shadowing" date: 2016-01-14 21:13 comments: true -categories: - - go +tags: tag1, tag2.. ''' metadata_fmt = """--- layout: post title: "{}" date: {} comments: true -categories: -{} +tags: {} --- """ catblock = " - {}" @@ -39,7 +36,7 @@ cats = map(catblock.format, tags.split()) metadata_fmt = metadata_fmt.format( blog_title, title_date, - '\n'.join(cats) + ', '.join(cats) ) with open('blog/{}'.format(filename), 'w') as f: