aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-04-29 13:28:33 +0200
committern-peugnet <n.peugnet@free.fr>2022-04-29 13:28:33 +0200
commit6f586bd8314571785dcc99b293f4e14594b369af (patch)
treecb97ab1493fc2e5bb44f32eeb1c1f8da54bec50d
parente0f5174b7ef47ed2373a8f20608e7c65c5f4a3b4 (diff)
downloadclub1-docs-6f586bd8314571785dcc99b293f4e14594b369af.tar.gz
club1-docs-6f586bd8314571785dcc99b293f4e14594b369af.zip
feat: add very basic index templaten-peugnet-html-index
It based on nginx's one, with the meta viewport added, as it is not there by default (see https://mailman.nginx.org/pipermail/nginx-devel/2020-November/013609.html) It could be customized later.
-rw-r--r--Makefile11
-rw-r--r--_templates/index.html17
2 files changed, 27 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 364fdf9..fd942d5 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ SPHINXLBUILDERS := $(foreach b,$(SPHINXBUILDERS),$(LANGUAGES:%=$b/%))
SPHINXCMDS := gettext changes xml pseudoxml linkcheck
SOURCEDIR := .
BUILDDIR := _build
+DIRS := $(SPHINXBUILDERS:%=$(BUILDDIR)/%)
PUBHOST ?= club1.fr
PUBDIR ?= /var/www/docs
@@ -32,6 +33,9 @@ help:
.PHONY: help clean update-po latexpdf info publish $(SPHINXBUILDERS) $(SPHINXLBUILDERS) $(SPHINXCMDS)
+$(DIRS):
+ mkdir -p $@
+
update-po: $(LOCALEFILES);
%.mo: %.po
@@ -57,11 +61,16 @@ $(LANGUAGES:%=latexpdf/%): latexpdf/%: latex/%
$(LANGUAGES:%=info/%): info/%: texinfo/%
$(MAKE) -C $(BUILDDIR)/$<
+$(BUILDDIR)/html/index.html: _templates/index.html | $(BUILDDIR)/html
+ cp $< $@
+
publish:
rsync -av --del --exclude='.*' _build/html/ $(USER)@$(PUBHOST):$(PUBDIR)
# Shinx builders that builds localized versions.
-$(SPHINXBUILDERS): %: $(LANGUAGES:%=\%/%);
+$(filter-out html,$(SPHINXBUILDERS)): %: $(LANGUAGES:%=\%/%);
+
+html: $(LANGUAGES:%=html/%) $(BUILDDIR)/html/index.html
# Localized Sphinx builders
.SECONDEXPANSION:
diff --git a/_templates/index.html b/_templates/index.html
new file mode 100644
index 0000000..777fa9d
--- /dev/null
+++ b/_templates/index.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+ <title>Index of /docs/</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+</head>
+<body>
+ <h1>Index of /docs/</h1>
+ <hr/>
+
+<pre>
+<a href="en/">en/</a>
+<a href="fr/">fr/</a>
+</pre>
+
+ <hr/>
+</body>
+</html>