Blob


1 MANPAGES = gemexp.1 \
2 gg.1 \
3 gmid.conf.5 \
4 gmid.8 \
5 titan.1
7 PAGES = index.gmi \
8 changelog.gmi \
9 contrib.gmi \
10 quickstart.gmi \
11 faq.gmi
13 TITLE_index.gmi = home
14 TITLE_changelog.gmi = changelog
15 TITLE_contrib.gmi = contrib
16 TITLE_quickstart.gmi = guide
17 TITLE_faq.gmi = faq
19 REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/gmid.svg
20 REPOLOGY_URL = https://repology.org/project/gmid/versions
22 SUBST = ./subst GITHUB=https://github.com/omar-polo/gmid \
23 SITE=https://ftp.omarpolo.com \
24 VERS=2.0.1 \
25 PUBKEY=gmid-2.0.pub \
26 TREE=https://github.com/omar-polo/gmid/blob/master
28 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi REPOLOGY=${REPOLOGY_URL}
29 SUBST_WWW = ${SUBST} MANEXT=html EXT=html REPOLOGY=${REPOLOGY_BANNER}
31 .PHONY: all dirs manpages serve-www serve-gemini upload clean titles
33 all: dirs manpages pages
34 cp style.css mandoc.css www/
35 cp vim-screenshot.png www/
36 cp vim-screenshot.png gemini/
38 dirs:
39 mkdir -p gemini www
41 MANOPTS = -Oman='%N.%S.html;https://man.openbsd.org/%N.%S',style=mandoc.css
43 manpages:
44 .for m in ${MANPAGES}
45 @echo generating www/${m:T}.html
46 cd .. && man -Thtml ${MANOPTS} -l $m > site/www/${m:T}.html
47 man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
48 .endfor
50 pages:
51 .for p in ${PAGES}
52 ${MAKE} titles-gem | ./menu.pl $p gemini > gemini/$p
53 ${SUBST_GEM} $p >> gemini/$p
55 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
56 ${MAKE} titles-www | ./menu.pl "${p:.gmi=.html}" html >> www/${p:.gmi=.html}
57 ${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
58 cat footer.html >> www/${p:.gmi=.html}
59 .endfor
61 serve-www:
62 python3 -m http.server --directory www 8888
64 serve-gemini:
65 ./../gemexp ./gemini
67 upload:
68 openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/gmid.omarpolo.com
69 openrsync --rsync-path=openrsync --del -a gemini/ antartica:/var/gemini/gmid.omarpolo.com
71 titles-gem:
72 .for p in ${PAGES}
73 @printf "%s %s\n" "${p}" ${TITLE_${p}:Q}
74 .endfor
76 titles-www:
77 .for p in ${PAGES}
78 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
79 .endfor