gmid/site/Makefile

75 lines
1.8 KiB
Makefile
Raw Normal View History

MANPAGES = ../gmid.1 \
../gmid.conf.5 \
../gg.1
2021-10-04 12:42:35 +02:00
PAGES = index.gmi \
changelog.gmi \
contrib.gmi \
2022-04-07 18:27:16 +02:00
quickstart.gmi \
faq.gmi
2021-10-04 12:42:35 +02:00
TITLE_index.gmi = home
TITLE_changelog.gmi = changelog
TITLE_contrib.gmi = contrib
TITLE_quickstart.gmi = guide
TITLE_faq.gmi = faq
2021-10-04 12:42:35 +02:00
REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/gmid.svg
REPOLOGY_URL = https://repology.org/project/gmid/versions
SUBST = ./subst GITHUB=https://github.com/omar-polo/gmid \
2022-12-02 16:21:20 +01:00
VERS=1.8.6 \
2022-01-30 14:35:45 +01:00
CURV=1.8 \
NEXTV=1.9 \
TREE=https://github.com/omar-polo/gmid/blob/master
SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi REPOLOGY=${REPOLOGY_URL}
SUBST_WWW = ${SUBST} MANEXT=html EXT=html REPOLOGY=${REPOLOGY_BANNER}
.PHONY: all dirs manpages serve-www serve-gemini upload clean titles
all: dirs manpages pages
2022-12-02 16:21:20 +01:00
cp style.css mandoc.css www/
cp vim-screenshot.png www/
cp vim-screenshot.png gemini/
dirs:
mkdir -p gemini www
manpages:
.for m in ${MANPAGES}
2022-12-02 16:21:20 +01:00
man -Thtml -Ostyle=mandoc.css $m > www/${m:T}.html
man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
.endfor
pages:
.for p in ${PAGES}
${MAKE} titles-gem | ./menu.pl $p gemini > gemini/$p
${SUBST_GEM} $p >> gemini/$p
${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
${MAKE} titles-www | ./menu.pl "${p:.gmi=.html}" html >> www/${p:.gmi=.html}
${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
cat footer.html >> www/${p:.gmi=.html}
.endfor
2021-10-04 14:54:46 +02:00
serve-www:
python3 -m http.server --directory www 8888
2021-10-04 14:54:46 +02:00
serve-gemini:
gmid -p 1966 ./gemini
upload:
2022-03-26 12:18:02 +01:00
openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/gmid.omarpolo.com
openrsync --rsync-path=openrsync --del -a gemini/ antartica:/var/gemini/gmid.omarpolo.com
titles-gem:
.for p in ${PAGES}
@printf "%s %s\n" "${p}" ${TITLE_${p}:Q}
.endfor
titles-www:
.for p in ${PAGES}
@printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
.endfor