Blob


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