Blob


1 MANPAGES = ../gmid.1 \
2 ../gmid.conf.5 \
3 ../gg.1
5 PAGES = index.gmi \
6 changelog.gmi \
7 contrib.gmi \
8 quickstart.gmi \
9 faq.gmi
11 TITLE_index.gmi = home
12 TITLE_changelog.gmi = changelog
13 TITLE_contrib.gmi = contrib
14 TITLE_quickstart.gmi = guide
15 TITLE_faq.gmi = faq
17 REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/gmid.svg
18 REPOLOGY_URL = https://repology.org/project/gmid/versions
20 SUBST = ./subst GITHUB=https://github.com/omar-polo/gmid \
21 VERS=1.8.4 \
22 CURV=1.8 \
23 NEXTV=1.9 \
24 TREE=https://github.com/omar-polo/gmid/blob/master
26 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi REPOLOGY=${REPOLOGY_URL}
27 SUBST_WWW = ${SUBST} MANEXT=html EXT=html REPOLOGY=${REPOLOGY_BANNER}
29 .PHONY: all dirs manpages serve-www serve-gemini upload clean titles
31 all: dirs manpages pages
32 cp style.css www/
33 cp vim-screenshot.png www/
34 cp vim-screenshot.png gemini/
36 dirs:
37 mkdir -p gemini www
39 manpages:
40 .for m in ${MANPAGES}
41 ./mdoc2html.sh $m www/${m:T}.html
42 man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
43 .endfor
45 pages:
46 .for p in ${PAGES}
47 ${MAKE} titles-gem | ./menu.pl $p gemini > gemini/$p
48 ${SUBST_GEM} $p >> gemini/$p
50 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
51 ${MAKE} titles-www | ./menu.pl "${p:.gmi=.html}" html >> www/${p:.gmi=.html}
52 ${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
53 cat footer.html >> www/${p:.gmi=.html}
54 .endfor
56 serve-www:
57 python3 -m http.server --directory www 8888
59 serve-gemini:
60 gmid -p 1966 ./gemini
62 upload:
63 openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/gmid.omarpolo.com
64 openrsync --rsync-path=openrsync --del -a gemini/ antartica:/var/gemini/gmid.omarpolo.com
66 titles-gem:
67 .for p in ${PAGES}
68 @printf "%s %s\n" "${p}" ${TITLE_${p}:Q}
69 .endfor
71 titles-www:
72 .for p in ${PAGES}
73 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
74 .endfor