diff --git a/website/.gitignore b/website/.gitignore index a2e526e..7a28985 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -27,3 +27,5 @@ /site.cfg /untitled/ /website.tar.gz +/pages/footer.include +/pages/footer-git-commit.include diff --git a/website/Makefile.am b/website/Makefile.am index 37384d5..1153f92 100644 --- a/website/Makefile.am +++ b/website/Makefile.am @@ -30,11 +30,36 @@ index.html: index.html.tmpl history/git-history.jpg: history/git-history.dot dot -T jpg history/git-history.dot > "$@" +# We need force the regeneration of the page because if only the git +# commit changes, there is no way to know about it. In addition the +# full website is regenerated each time the build target is run, so +# generating one more page has insignificant performance impact. +.PHONY: pages/footer-git-commit.include +pages/footer-git-commit.include: + rm -f $@ + + printf "This page was generated with %s from the commit %s\n" \ + "[Untitled](https://untitled.vimuser.org/)" \ + "`git show --no-patch HEAD --pretty=\"%h\"`" \ + >> $@ + + printf "(\"%s\").\n" \ + "`git show --no-patch HEAD --pretty=\"%s\"`" \ + >> $@ + + printf "\n" >> $@ + +pages/footer.include: pages/footer.include.tmpl pages/footer-git-commit.include + cat \ + pages/footer.include.tmpl \ + pages/footer-git-commit.include \ + > $@ + site.cfg: site.cfg.tmpl sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@" if WANT_GUIX -build: site.cfg +build: site.cfg pages/footer.include guix time-machine \ --commit=c15a1cd88f80a90437f4b0159f22dfc84b9e6851 \ -- shell \ @@ -53,7 +78,7 @@ build: site.cfg -- \ ./build.sh $(BUILD_OPTIONS) else -build: site.cfg +build: site.cfg pages/footer.include ./build.sh $(BUILD_OPTIONS) endif diff --git a/website/build.sh b/website/build.sh index 3e8892b..1ef9d3e 100755 --- a/website/build.sh +++ b/website/build.sh @@ -148,5 +148,9 @@ if [ "${download_only}" -eq 0 ] ; then copy_website "untitled/www/lbwww/" cd untitled + + # Remove "This HTML page was generated by the Untitled Static Site + # Generator." at the bottom of each page as it is already mentionned above. + sed 's/^SHAMELESS_PLUG=".*"/SHAMELESS_PLUG=""/g' -i lang/*/strings.cfg ./build sites lbwww fi diff --git a/website/pages/footer.include b/website/pages/footer.include.tmpl similarity index 100% rename from website/pages/footer.include rename to website/pages/footer.include.tmpl