Blob


1 RSYNC = openrsync --rsync-path=openrsync
3 MANPAGES = ../telescope.1
5 PAGES = index.gmi \
6 gallery.gmi
7 # changelog.gmi
9 TITLE_index.gmi = Home
10 TITLE_changelog.gmi = ChangeLog
11 TITLE_gallery.gmi = Gallery
13 REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/telescope.svg
14 REPOLOGY_URL = https://repology.org/project/telescope/versions
16 SUBST = ./subst CURRV=0.9 CURRKEY=0.9 NEXTKEY=0.10 \
17 CURRSIGN=RWSmshjFM8Q0IDYUd4I/8G2q9Y0DUaZLac4enOtQh5rzsIcVF+ePXCy7 \
18 REPOLOGY_BANNER=${REPOLOGY_BANNER} \
19 REPOLOGY_URL=${REPOLOGY_URL}
21 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi
22 SUBST_WWW = ${SUBST} MANEXT=html EXT=html
24 .PHONY: all dirs manpages serve-www serve-gemini upload clean titles
26 all: dirs manpages pages
27 cp logo.png gemini/
28 cp mandoc.css style.css www/
29 cp logo.png www/
30 cp -R gallery gemini
31 cp -R gallery www
32 convert logo.png -resize 200x200 www/logo.small.png
34 dirs:
35 mkdir -p gemini www
37 manpages:
38 .for m in ${MANPAGES}
39 man -O style=mandoc.css -Thtml -l $m > www/${m:T}.html
40 man -O width=64 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
41 .endfor
43 pages:
44 .for p in ${PAGES}
45 grep -v '^<' $p | ${SUBST_GEM} > gemini/$p
47 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/$p
48 ${MAKE} titles | ./menu.pl "${p:.gmi=.html}" >> www/$p
49 ${SUBST_WWW} $p | ./gem2html >> www/$p
50 cat footer.html >> www/$p
51 cd www && mv $p ${p:.gmi=.html}
52 .endfor
54 serve-www:
55 python3 -m http.server --directory www 8888
57 serve-gemini:
58 ge -p 1966 gemini
60 upload:
61 ${RSYNC} --del -a gemini/ antartica:/var/gemini/telescope.omarpolo.com
62 ${RSYNC} --del -a www/ antartica:/var/www/telescope.omarpolo.com
64 clean:
65 rm -rf gemini www
67 titles:
68 .for p in ${PAGES}
69 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
70 .endfor