Weeknotes archetype and Makefile rule
This commit is contained in:
parent
7ff50445f5
commit
851f676ca0
2 changed files with 19 additions and 0 deletions
10
Makefile
10
Makefile
|
@ -1,5 +1,7 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
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/
|
||||
|
|
9
archetypes/weeknotes.md
Normal file
9
archetypes/weeknotes.md
Normal file
|
@ -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
|
||||
---
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue