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

Joonas Kylmälä joonas.kylmala at iki.fi
Tue Apr 23 16:05:55 UTC 2019


If you remove the extra empty line from the end of Makefile then:

Reviewed-by: Joonas Kylmälä <joonas.kylmala at iki.fi>

Denis 'GNUtoo' Carikli:
> 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 7c4842b..1b9990c 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..ba757ab
> --- /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 without
> +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.
> 


More information about the Replicant mailing list