diff --git a/Makefile b/Makefile index 494d569..f4b0b41 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ # Eryn Wells +CONTENT_PATH=content + DEPLOY_USER=eryn DEPLOY_HOSTNAME=nutmeg.erynwells.me DEPLOY_PATH=/srv/www/erynwells.me/html @@ -32,5 +34,13 @@ endif nethack-commit: $(NETHACK_LOGFILE_DATA_FILE) if ! git diff --quiet $<; then git commit -m "Update Nethack logfile for $(HOSTNAME)" -- $<; fi +weeknotes: YEAR=$(shell date '+%Y') +weeknotes: WEEK_NUMBER=$(shell date '+%V') +weeknotes: UPCOMING_SUNDAY=$(shell date -v +Sun +%FT%T%z) +weeknotes: PAGE_PATH=blog/$(YEAR)/weeknotes-$(YEAR)w$(WEEK_NUMBER).md +weeknotes: $(CONTENT_PATH)/$(PAGE_PATH) + hugo new -k weeknotes --clock "$(UPCOMING_SUNDAY)" -c "$(CONTENT_PATH)" "$(PAGE_PATH)" + sed -I -e "s/%%WEEK_NUMBER%%/$(WEEK_NUMBER)/" "$(CONTENT_PATH)/$(PAGE_PATH)" + clean: rm -rf public/ diff --git a/archetypes/weeknotes.md b/archetypes/weeknotes.md new file mode 100644 index 0000000..93bbb34 --- /dev/null +++ b/archetypes/weeknotes.md @@ -0,0 +1,9 @@ +--- +title: "Weeknotes for {{ time.Now.Format "2006" }}W%%WEEK_NUMBER%%" +slug: weeknotes-{{ time.Now.Format "2006" }}w%%WEEK_NUMBER%% +date: {{ .Date }} +categories: weeknotes +tags: [] +draft: true +--- +