mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 18:36:21 +00:00
feat(cli::template) update post template
This commit is contained in:
1 file changed
+8
-7
@@ -10,13 +10,14 @@ from utils.lang import eprint, wprint
|
|||||||
|
|
||||||
POST_TEMPLATE = '''
|
POST_TEMPLATE = '''
|
||||||
---
|
---
|
||||||
|
uuid: {{ uuid }}
|
||||||
title: {{ title }}
|
title: {{ title }}
|
||||||
subtitle: {{ subtitle }}
|
subtitle: {{ subtitle }}
|
||||||
published_date: {{ published_date }}
|
status: {{ status }}
|
||||||
last_updated: {{ last_update }}
|
date: {{ date }}
|
||||||
|
update: {{ update }}
|
||||||
category: {{ category }}
|
category: {{ category }}
|
||||||
tags: {{ tags }}
|
tags: {{ tags }}
|
||||||
uuid: {{ uuid }}
|
|
||||||
---
|
---
|
||||||
|
|
||||||
WIP
|
WIP
|
||||||
@@ -38,9 +39,9 @@ def get_subtitle():
|
|||||||
return input("subtitle > ")
|
return input("subtitle > ")
|
||||||
|
|
||||||
|
|
||||||
def get_published_date():
|
def get_date():
|
||||||
while True:
|
while True:
|
||||||
d = input("published_date (YYYY-MM-DD) > ")
|
d = input("date (YYYY-MM-DD) > ")
|
||||||
if d == "":
|
if d == "":
|
||||||
wprint("using today's date")
|
wprint("using today's date")
|
||||||
return dt.today().strftime("%Y-%m-%d")
|
return dt.today().strftime("%Y-%m-%d")
|
||||||
@@ -78,8 +79,8 @@ class BlogPost(Template):
|
|||||||
index_md = POST_TEMPLATE.format(
|
index_md = POST_TEMPLATE.format(
|
||||||
title=get_title(),
|
title=get_title(),
|
||||||
subtitle=get_subtitle(),
|
subtitle=get_subtitle(),
|
||||||
published_date=get_published_date(),
|
date=get_date(),
|
||||||
last_update=dt.today().strftime("%Y-%m-%d"),
|
update=dt.today().strftime("%Y-%m-%d"),
|
||||||
tags=get_tags(),
|
tags=get_tags(),
|
||||||
category=get_category(),
|
category=get_category(),
|
||||||
uuid=uuid.uuid4()
|
uuid=uuid.uuid4()
|
||||||
|
|||||||
Reference in new issue
Block a user