diff options
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 > $@ |