From 373e8a7c5e15f6ea09e924797cd7119506440a17 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sat, 23 Sep 2023 12:58:50 -0700 Subject: [PATCH] Trim date from archetype title --- archetypes/default.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index 88fb308b..0b914787 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,10 +1,11 @@ +{{- $now := now -}} +++ categories = [] date = "{{ .Date }}" description = "" draft = true -id = "{{ print .File.Path now.UnixNano | sha1 }}" +id = "{{ print .File.Path $now.UnixNano | sha1 }}" link = "" tags = [] -title = "{{ replace .Name "-" " " | title }}" +title = "{{ replace (strings.TrimPrefix (print ($now.Format `2006-01-02`) `-`) .Name) `-` ` ` | title }}" +++