Blob


1 MANPAGES = ../gmid.1 \
2 ../gg.1
4 PAGES = index.gmi \
5 changelog.gmi \
6 contrib.gmi \
7 quickstart.gmi
9 TITLE_index.gmi = home
10 TITLE_changelog.gmi = changelog
11 TITLE_contrib.gmi = contrib
12 TITLE_quickstart.gmi = quickstart
14 REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/gmid.svg
15 REPOLOGY_URL = https://repology.org/project/gmid/versions
17 SUBST = ./subst GITHUB=https://github.com/omar-polo/gmid \
18 VERS=1.7.5 \
19 CURV=1.7 \
20 NEXTV=1.8
22 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi REPOLOGY=${REPOLOGY_URL}
23 SUBST_WWW = ${SUBST} MANEXT=html EXT=html REPOLOGY=${REPOLOGY_BANNER}
25 .PHONY: all dirs manpages serve-www serve-gemini upload clean titles
27 all: dirs manpages pages
28 cp style.css www/
29 cp vim-screenshot.png www/
30 cp vim-screenshot.png gemini/
32 dirs:
33 mkdir -p gemini www
35 manpages:
36 .for m in ${MANPAGES}
37 ./mdoc2html.sh $m www/${m:T}.html
38 man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
39 .endfor
41 pages:
42 .for p in ${PAGES}
43 ${MAKE} titles-gem | ./menu.pl $p gemini > gemini/$p
44 ${SUBST_GEM} $p >> gemini/$p
46 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
47 ${MAKE} titles-www | ./menu.pl "${p:.gmi=.html}" html >> www/${p:.gmi=.html}
48 ${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
49 cat footer.html >> www/${p:.gmi=.html}
50 .endfor
52 serve-www:
53 python3 -m http.server --directory www 8888
55 serve-gemini:
56 gmid -p 1966 ./gemini
58 upload:
59 rsync --delete -a www/ op:sites/gmid.omarpolo.com
60 rsync --delete -a gemini/ op:gemini/gmid.omarpolo.com
62 titles-gem:
63 .for p in ${PAGES}
64 @printf "%s %s\n" "${p}" ${TITLE_${p}:Q}
65 .endfor
67 titles-www:
68 .for p in ${PAGES}
69 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
70 .endfor