diff options
author | EuAndreh <eu@euandre.org> | 2025-04-29 19:23:08 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-29 19:38:39 -0300 |
commit | f460739a0c316a5711a241453967de93572a7aa3 (patch) | |
tree | 429d3d8657ad788b0638d2a858e3ba2c48e30a91 /Makefile | |
parent | src/content/img/: Adjust light/dark mode SVGs (diff) | |
download | euandre.org-f460739a0c316a5711a241453967de93572a7aa3.tar.gz euandre.org-f460739a0c316a5711a241453967de93572a7aa3.tar.xz |
Makefile: Add sitemap.xml
Diffstat (limited to '')
-rw-r--r-- | Makefile | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -26,9 +26,9 @@ BASEURL = / .SUFFIXES: -.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .txt +.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .mapentry .sortdata .xml .SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html .links .caslinks -.SUFFIXES: .categorydata .gz .torrent .flac .ogg +.SUFFIXES: .txt .categorydata .gz .torrent .flac .ogg .adoc.conf: mkwb conf src/global.conf $< > $@ @@ -54,6 +54,9 @@ BASEURL = / .htmlbody.feedentry: mkwb feedentry $< > $@ +.conf.mapentry: + mkwb mapentry $< > $@ + .conf.sortdata: mkwb sortdata $< > $@ @@ -86,6 +89,7 @@ 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) +sources.mapentry = $(sources.adoc:.adoc=.mapentry) articles.indexentry = $(articles.adoc:.adoc=.indexentry) articles.feedentry = $(articles.adoc:.adoc=.feedentry) articles.sortdata = $(articles.adoc:.adoc=.sortdata) @@ -112,6 +116,7 @@ sources = \ dynamic-contents = \ $(sources.html) \ $(feeds.xml) \ + src/content/sitemap.xml \ static-contents = \ $(sources.extras) \ @@ -157,9 +162,10 @@ derived-assets = \ $(sources.htmlbody) \ $(sources.snippets) \ $(sources.snippets.gz) \ + $(sources.conf) \ $(sources.links) \ $(sources.caslinks) \ - $(sources.conf) \ + $(sources.mapentry) \ src/dyn.conf \ src/base.conf \ src/global.conf \ @@ -287,6 +293,10 @@ $(sources.media.torrent): F="`printf '%s\n' $* | cut -d/ -f3-`" && \ mktorrent -xfd -n $(*F) -o $@ -w "https://$(NAME)$(BASEURL)$${F}" $* +src/content/sitemap.xml.gz: src/content/sitemap.xml +src/content/sitemap.xml: $(sources.mapentry) + mkwb sitemap $(sources.mapentry) > $@ + email.txt: meta.json jq -r '.email' < meta.json > $@ @@ -383,7 +393,18 @@ check-unit-links: check-unit-links-internal check-unit-links-external check-unit-links: check-unit-symlinks +MAXSIZE = 52428800 # from spec: https://www.sitemaps.org/protocol.html +check-unit-sitemap-size: src/content/sitemap.xml + test "`stat --printf='%s' src/content/sitemap.xml`" -le $(MAXSIZE) + +check-unit-sitemap-count: src/content/sitemap.xml + test "`grep -cF '</url>' src/content/sitemap.xml`" -le 50000 + +check-unit-sitemap: check-unit-sitemap-count check-unit-sitemap-size + + check-unit: check-unit-sorting check-unit-updatedat check-unit-links +check-unit: check-unit-sitemap integration-tests = \ |