From 30d0cdf4059439786699b77cf0d406947f727894 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 19 Aug 2022 16:12:35 -0500 Subject: Paginate --- Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1fa687a..28c668e 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,29 @@ REPO = https://tildegit.org/casa/pages/raw/branch/main/opml/mug.of.opml OUTD = /var/www/acdw.casa/fwends/ RC = sfeedrc FEEDS = feeds -FILES = index.html style.css +FILES = index.html style.css p*.html AGGREGATOR = ./fwendplanet.sh -MAXAGE = 60 +PAGEN = 60 # 2 months .PHONY: publish publish: build mkdir -p $(OUTD) - cp $(FILES) $(OUTD) + rsync -avz --delete $(FILES) $(OUTD) .PHONY: build build: $(RC) - sfeed_update $(RC) || true - $(AGGREGATOR) $(FEEDS) $(MAXAGE) >index.html + -rm p*.html + #-sfeed_update $(RC) + NEXT=p2.html PREV=0 $(AGGREGATOR) $(FEEDS) 1 $(PAGEN) >index.html + NEXT=p3.html PREV=index.html $(AGGREGATOR) $(FEEDS) 2 $(PAGEN) >pn.html + N=2; while grep '
' pn.html >/dev/null 2>&1; do \ + mv pn.html p$$N.html; \ + N=$$((N+1)); \ + NEXT=p$$((N+1)).html PREV=p$$((N-1)).html\ + $(AGGREGATOR) $(FEEDS) $$N $(PAGEN) >pn.html; \ + done; \ + rm pn.html; \ + NEXT=0 PREV=p$$((N-2)).html $(AGGREGATOR) $(FEEDS) $$((N-1)) $(PAGEN) >p$$((N-1)).html $(RC): curl -L $(REPO) | sfeed_opml_import > $@ -- cgit 1.4.1-21-gabe81