diff options
author | Case Duckworth | 2022-08-19 16:12:35 -0500 |
---|---|---|
committer | Case Duckworth | 2022-08-19 16:12:35 -0500 |
commit | 30d0cdf4059439786699b77cf0d406947f727894 (patch) | |
tree | 68148b17dd974ca62dd2bd8525a2e06b65497c00 /Makefile | |
parent | Initialize (diff) | |
download | fwendplanet-30d0cdf4059439786699b77cf0d406947f727894.tar.gz fwendplanet-30d0cdf4059439786699b77cf0d406947f727894.zip |
Paginate
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 15 insertions, 5 deletions
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 | |||
3 | OUTD = /var/www/acdw.casa/fwends/ | 3 | OUTD = /var/www/acdw.casa/fwends/ |
4 | RC = sfeedrc | 4 | RC = sfeedrc |
5 | FEEDS = feeds | 5 | FEEDS = feeds |
6 | FILES = index.html style.css | 6 | FILES = index.html style.css p*.html |
7 | AGGREGATOR = ./fwendplanet.sh | 7 | AGGREGATOR = ./fwendplanet.sh |
8 | MAXAGE = 60 | 8 | PAGEN = 60 # 2 months |
9 | 9 | ||
10 | .PHONY: publish | 10 | .PHONY: publish |
11 | publish: build | 11 | publish: build |
12 | mkdir -p $(OUTD) | 12 | mkdir -p $(OUTD) |
13 | cp $(FILES) $(OUTD) | 13 | rsync -avz --delete $(FILES) $(OUTD) |
14 | 14 | ||
15 | .PHONY: build | 15 | .PHONY: build |
16 | build: $(RC) | 16 | build: $(RC) |
17 | sfeed_update $(RC) || true | 17 | -rm p*.html |
18 | $(AGGREGATOR) $(FEEDS) $(MAXAGE) >index.html | 18 | #-sfeed_update $(RC) |
19 | NEXT=p2.html PREV=0 $(AGGREGATOR) $(FEEDS) 1 $(PAGEN) >index.html | ||
20 | NEXT=p3.html PREV=index.html $(AGGREGATOR) $(FEEDS) 2 $(PAGEN) >pn.html | ||
21 | N=2; while grep '<details>' pn.html >/dev/null 2>&1; do \ | ||
22 | mv pn.html p$$N.html; \ | ||
23 | N=$$((N+1)); \ | ||
24 | NEXT=p$$((N+1)).html PREV=p$$((N-1)).html\ | ||
25 | $(AGGREGATOR) $(FEEDS) $$N $(PAGEN) >pn.html; \ | ||
26 | done; \ | ||
27 | rm pn.html; \ | ||
28 | NEXT=0 PREV=p$$((N-2)).html $(AGGREGATOR) $(FEEDS) $$((N-1)) $(PAGEN) >p$$((N-1)).html | ||
19 | 29 | ||
20 | $(RC): | 30 | $(RC): |
21 | curl -L $(REPO) | sfeed_opml_import > $@ | 31 | curl -L $(REPO) | sfeed_opml_import > $@ |