From df7ec5a70f0effd1c7749392a86c3d7adaf83364 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 4 Jul 2016 07:26:37 +0200 Subject: Add git hash as query string to resources ..to be able to set an infinite cache for the browser, but to invalidate the resources for every git commit (That may be a waste of resources, but is "most safe" to ensure we get an up to date site) It has to be explicitly defined in the template. Occurences of the img-tag in the source files get the git hash automatically appended. --- Makefile | 3 ++- xsl/common.xsl | 2 ++ xsl/img.xsl | 23 +++++++++++++++++++++++ xsl/layout.xsl | 10 +++++----- 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 xsl/img.xsl diff --git a/Makefile b/Makefile index a36830b..01cb9b0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ suffix = .xhtml +version = $(shell git rev-parse --short HEAD) -xsltproc=xsltproc --stringparam suffix $(suffix) --stringparam stylesheet style.min.css +xsltproc=xsltproc --stringparam suffix $(suffix) --stringparam stylesheet style.min.css --stringparam version $(version) svg2png=rsvg-convert -f png pages=$(shell xsltproc xsl/main_filenames.xsl main.xml) diff --git a/xsl/common.xsl b/xsl/common.xsl index f9387dc..07acb7d 100644 --- a/xsl/common.xsl +++ b/xsl/common.xsl @@ -9,6 +9,7 @@ + @@ -16,6 +17,7 @@ + + + + + + + + + + + + + ? + + + + + diff --git a/xsl/layout.xsl b/xsl/layout.xsl index 394e23a..c10b4b6 100644 --- a/xsl/layout.xsl +++ b/xsl/layout.xsl @@ -17,7 +17,7 @@ - +
@@ -51,7 +51,7 @@
- +
@@ -70,14 +70,14 @@