When editing weeknotes with the website script, create the page from the Hugo archetype and process it

This implements what the Makefile did, but with a more intuitive interface.
Remove the weeknotes target from the Makefile.
This commit is contained in:
Eryn Wells 2024-12-10 11:46:29 -08:00
parent 8ec88e6c80
commit b9796ab096
4 changed files with 71 additions and 22 deletions

View file

@ -38,13 +38,5 @@ 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 scripts/weeknotes show --date)
weeknotes: PAGE_PATH=$(shell scripts/weeknotes show)
weeknotes: $(PAGE_PATH)
hugo new -k weeknotes --clock "$(UPCOMING_SUNDAY)" -c "$(CONTENT_PATH)" "$(PAGE_PATH)"
sed -I -e "s/%%WEEK_NUMBER%%/$(WEEK_NUMBER)/" "$(PAGE_PATH)"
clean:
rm -rf "$(BUILD_DIR)/"