From: Amin Bandali Date: Sun, 16 May 2021 20:23:53 +0000 (-0400) Subject: don't regenerate the feeds when non-note m4 files change X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/commitdiff_plain/ccd7a4805a0486cb1bf38706c2872be36fb0fc8c?ds=inline;hp=c5d21f5538f970f6145160826979f3663bb3d383 don't regenerate the feeds when non-note m4 files change --- diff --git a/GNUmakefile b/GNUmakefile index 36c83f8..321b19d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -24,13 +24,14 @@ SITE_URL := '$(SITE_DOMAIN)$(SITE_PREFIX)' SRC := $(filter-out $(wildcard meta_*), $(wildcard *.m4)) OUTPUTS := $(patsubst %.m4,out/%.html, $(SRC)) STATIC := $(patsubst static/%,out/%, $(filter-out static/GNUmakefile, $(wildcard static/* static/.*))) +NOTES := $(shell ./get-notes.sh) all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css out/GNUmakefile $(STATIC) out/%.html: %.m4 header.html footer.html @mkdir -p $(@D) m4 -D__d=$(SITE_DOMAIN) -D__p=$(SITE_PREFIX) $< > $@ -out/notes.%: meta_feed_%.m4 $(SRC) header.html footer.html +out/notes.%: meta_feed_%.m4 $(NOTES) header.html footer.html m4 -D__d=$(SITE_DOMAIN) -D__p=$(SITE_PREFIX) $< > $@ sed -i 's|href="/\([^/]\)|href="$(SITE_DOMAIN)/\1|' $@ sed -i 's|href="//|href="https://|' $@ diff --git a/get-notes.sh b/get-notes.sh new file mode 100755 index 0000000..fa6483b --- /dev/null +++ b/get-notes.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +i=1 +n=$(echo '__latest' | m4 meta_defs.m4 -) + +while [ $i -le $n ]; do + echo "_get(\`notes', $i).m4" | m4 meta_defs.m4 - + i=$(($i+1)) +done