[Replicant] [PATCH 2/3] Add a way to generate a static website

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Sun Apr 21 20:04:15 UTC 2019


Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 .gitignore |  2 ++
 Makefile   | 33 +++++++++++++++++++++++++++++++++
 README.txt | 14 ++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 Makefile
 create mode 100644 README.txt

diff --git a/.gitignore b/.gitignore
index c456b20..3a3aab7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 *~
 *.swp
 #.*#
+/cache/**
+*.html
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ebfcfe0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+DESTDIR ?= html
+
+TARGETS = \
+	about.html \
+	freedom-privacy-security-issues.html \
+	index.html \
+	javascript.html \
+	screenshots.html \
+	supported-devices.html \
+
+INSTALL_DIRECTORIES = \
+	css \
+	fonts \
+	images \
+	js \
+	library \
+
+all: $(TARGETS)
+
+$(DESTDIR):
+	mkdir -p $(DESTDIR)
+
+%.html: %.php
+	php -f $< | sed 's#\.php#\.html#g' > $@
+
+clean:
+	rm -f $(TARGETS)
+	rm -f cache/*.spc
+
+install: $(DESTDIR) all
+	install -m644 $(TARGETS) -t $(DESTDIR)
+	cp -a $(INSTALL_DIRECTORIES) $(DESTDIR)
+
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..7689c66
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,14 @@
+== Deployment strategies ==
+This website is intended to be deployed as a dynamic version
+because it contains dynamic elements for loading information
+from the forum and the git repositories.
+
+However deploying the website as a static version can still
+be useful, for instance for working on it locally wihtout
+requiring a web server, or for deploying a temporary static
+version during a maintenance operation on the machine hosting
+the website.
+
+To do that, run make in the top directory. It will then
+generate html files that can be viewed with a browser or
+temporarily hosted statically.
-- 
2.21.0



More information about the Replicant mailing list