Explorar el Código

fix how new post is created

Oz N Tiram hace 9 años
padre
commit
82bbf7e848
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      blogit/blogit.py

+ 4 - 4
blogit/blogit.py

@@ -428,12 +428,10 @@ def new_post(GITDIRECTORY=CONFIG['output_to'],
 
     author = CONFIG['author']
     date = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d')
-    tags = '[' + raw_input("Give the tags, separated by ', ':") + ']'
+    tags = raw_input("Give the tags, separated by ', ':")
     published = 'yes'
     chronological = 'yes'
-    summary = ("summary: |\n    Type your summary here.\n    Do not change the "
-               "indentation"
-               "to the left\n    ...\n\nStart writing your post here!")
+    summary = ("summary: Type your summary here.")
 
     # make file name
     fname = os.path.join(os.getcwd(), 'content', kind['name_plural'],
@@ -442,6 +440,7 @@ def new_post(GITDIRECTORY=CONFIG['output_to'],
                          date+'-'+title.replace(' ', '-')+'.markdown')
 
     with open(fname, 'w') as npost:
+        npost.write('---\n')
         npost.write('title: %s\n' % title)
         npost.write('author: %s\n' % author)
         npost.write('published: %s\n' % date)
@@ -450,6 +449,7 @@ def new_post(GITDIRECTORY=CONFIG['output_to'],
         npost.write('chronological: %s\n' % chronological)
         npost.write('kind: %s\n' % kind['name'])
         npost.write('%s' % summary)
+        npost.write('---\n')
 
     print('%s %s' % (CONFIG['editor'], repr(fname)))
     os.system('%s %s' % (CONFIG['editor'], fname))