summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-04-11 13:12:06 -0300
committerEuAndreh <eu@euandre.org>2025-04-11 14:51:32 -0300
commit94413ad645a866f8052a7cb67a188a8a0763104c (patch)
treed830bc7371737573cf5c0df7d98149ac9ff14afe /Makefile
parentsrc/content/: Make categories URL-friendly (diff)
downloadeuandre.org-94413ad645a866f8052a7cb67a188a8a0763104c.tar.gz
euandre.org-94413ad645a866f8052a7cb67a188a8a0763104c.tar.xz
Makefile: Generate a feed per category
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile92
1 files changed, 58 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index e7318c2..bf4f4d5 100644
--- a/Makefile
+++ b/Makefile
@@ -24,42 +24,45 @@ PUBURL = public.asc
.SUFFIXES:
-.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml
+.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .txt
.SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html .links .caslinks
-.SUFFIXES: .gz
+.SUFFIXES: .categorydata .gz
.adoc.conf:
mkwb conf src/global.conf $< > $@
.adoc.htmlbody:
- mkwb htmlbody $< > $@
+ mkwb htmlbody $< > $@
.htmlbody.html:
- mkwb html $< > $@
+ mkwb html $< > $@
.conf.htmlheader:
- mkwb html -H $< > $@
+ mkwb html -H $< > $@
.conf.htmlfooter:
- mkwb html -F $< > $@
+ mkwb html -F $< > $@
.conf.htmllisting:
- mkwb indexbody $< > $@
+ mkwb indexbody $< > $@
.adoc.snippets:
- mkwb snippets $< > $@
+ mkwb snippets $< > $@
.conf.indexentry:
- mkwb indexentry $< > $@
+ mkwb indexentry $< > $@
.htmlbody.feedentry:
- mkwb feedentry $< > $@
+ mkwb feedentry $< > $@
.conf.sortdata:
- mkwb sortdata $< > $@
+ mkwb sortdata $< > $@
+
+.conf.categorydata:
+ mkwb categorydata $< > $@
.adoc.links:
- mkwb links $< > $@
+ mkwb links $< > $@
.links.caslinks:
grep -v '^link:' $< | xargs -I_ sh -c '\
@@ -72,21 +75,24 @@ all:
include deps.mk
-sources.adoc = $(articles.adoc) $(listings.adoc) $(pages.adoc)
-sources.htmlbody = $(sources.adoc:.adoc=.htmlbody)
-sources.html = $(sources.adoc:.adoc=.html)
-sources.snippets = $(sources.adoc:.adoc=.snippets)
-sources.snippets.gz = $(sources.adoc:.adoc=.snippets.gz)
-sources.conf = $(sources.adoc:.adoc=.conf)
-sources.links = $(sources.adoc:.adoc=.links)
-sources.caslinks = $(sources.adoc:.adoc=.caslinks)
-articles.indexentry = $(articles.adoc:.adoc=.indexentry)
-articles.feedentry = $(articles.adoc:.adoc=.feedentry)
-articles.sortdata = $(articles.adoc:.adoc=.sortdata)
-listings.htmlheader = $(listings.adoc:.adoc=.htmlheader)
-listings.htmlfooter = $(listings.adoc:.adoc=.htmlfooter)
-listings.htmllisting = $(listings.adoc:.adoc=.htmllisting)
-listings.html = $(listings.adoc:.adoc=.html)
+sources.adoc = $(articles.adoc) $(listings.adoc) $(pages.adoc)
+sources.htmlbody = $(sources.adoc:.adoc=.htmlbody)
+sources.html = $(sources.adoc:.adoc=.html)
+sources.snippets = $(sources.adoc:.adoc=.snippets)
+sources.snippets.gz = $(sources.adoc:.adoc=.snippets.gz)
+sources.conf = $(sources.adoc:.adoc=.conf)
+sources.links = $(sources.adoc:.adoc=.links)
+sources.caslinks = $(sources.adoc:.adoc=.caslinks)
+articles.indexentry = $(articles.adoc:.adoc=.indexentry)
+articles.feedentry = $(articles.adoc:.adoc=.feedentry)
+articles.sortdata = $(articles.adoc:.adoc=.sortdata)
+articles.categorydata = $(articles.adoc:.adoc=.categorydata)
+listings.htmlheader = $(listings.adoc:.adoc=.htmlheader)
+listings.htmlfooter = $(listings.adoc:.adoc=.htmlfooter)
+listings.htmllisting = $(listings.adoc:.adoc=.htmllisting)
+listings.html = $(listings.adoc:.adoc=.html)
+categories.xml = $(categories.txt:.txt=.xml)
+categories.xml.gz = $(categories.txt:.txt=.xml.gz)
sources = \
$(sources.adoc) \
@@ -127,9 +133,11 @@ contents = \
src/content/security.txt \
src/content/security.txt.gz \
-all-snippets = \
+all-filelists = \
$(sources.snippets) \
$(sources.snippets.gz) \
+ $(categories.xml) \
+ $(categories.xml.gz) \
all-contents = \
$(contents) \
@@ -154,6 +162,10 @@ derived-assets = \
$(articles.indexentry) \
$(articles.feedentry) \
$(articles.sortdata) \
+ $(articles.categorydata) \
+ $(categories.txt) \
+ $(categories.xml) \
+ $(categories.xml.gz) \
email.txt \
baseurl.txt \
fingerprint.txt \
@@ -162,7 +174,7 @@ derived-assets = \
src/content/security.txt.gz \
src/content/.well-known/security.txt \
src/all-contents.txt \
- src/all-snippets-list.txt \
+ src/all-filelists.txt \
src/install.txt \
src/sort-expected.txt \
src/sort-given.txt \
@@ -175,6 +187,8 @@ side-assets = \
src/collections/*/*/*/*/*.html.*.txt.gz \
src/collections/*/index.html.*.txt \
src/collections/*/sortdata.txt \
+ src/collections/*/feed.*.xml \
+ src/collections/*/feed.*.xml.gz \
src/collections/*/*.sortdata \
src/pages/*/*.html.*.txt \
src/content/.well-known/ \
@@ -207,6 +221,16 @@ src/global.conf: src/base.conf
$(listings.html):
cat $*.htmlheader $*.htmllisting $*.htmlbody $*.htmlfooter > $@
+$(categories.txt):
+ mkwb categories $(@D) > $@
+
+$(categories.xml):
+ for f in `cat $*.txt`; do \
+ c="`printf '%s\n' "$$f" | cut -d. -f2`"; \
+ mkwb feed src/global.conf "$$f" > $(@D)/feed."$$c".xml; \
+ printf '%s\n' $(@D)/feed."$$c".xml; \
+ done > $@
+
$(feeds.xml):
mkwb feed src/global.conf $(@D)/sortdata.txt > $@
@@ -214,7 +238,7 @@ $(contents.gz):
gzip -9fk $*
touch $@
-$(sources.snippets.gz):
+$(sources.snippets.gz) $(categories.xml.gz):
if [ -s $* ]; then gzip -9fk `cat $*`; fi
sed 's/$$/.gz/' $* > $@
@@ -262,11 +286,11 @@ src/sources.txt:
src/all-contents.txt:
printf '%s\n' $(all-contents) > $@
-src/all-snippets-list.txt:
- printf '%s\n' $(all-snippets) > $@
+src/all-filelists.txt:
+ printf '%s\n' $(all-filelists) > $@
-src/install.txt: src/all-contents.txt src/all-snippets-list.txt $(all-snippets)
- cat src/all-contents.txt `cat src/all-snippets-list.txt` > $@
+src/install.txt: src/all-contents.txt src/all-filelists.txt $(all-filelists)
+ cat src/all-contents.txt `cat src/all-filelists.txt` > $@
sources.txt: src/sources.txt
install.txt: src/install.txt