From 5e93103dce2f3942c60e1242b0f227e921c5ed01 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Sun, 19 Nov 2023 06:28:06 -0500 Subject: [PATCH] Re-add cache busting Fix docs --- new/docs/index.html | 15 ++++++++------- new/download.html | 7 ++++--- new/features.html | 9 +++++---- new/includes/head.html | 14 ++++++++++++-- new/index.html | 16 ++++++++-------- new/sponsor.html | 9 +++++---- src/business.html | 2 +- src/includes/head.html | 5 +++-- 8 files changed, 46 insertions(+), 31 deletions(-) diff --git a/new/docs/index.html b/new/docs/index.html index 5503b47..6204d9b 100644 --- a/new/docs/index.html +++ b/new/docs/index.html @@ -2,15 +2,16 @@ Caddy Documentation - {{include "/includes/head.html"}} - - + {{import "/includes/head.html"}} + {{template "head"}} + + - - - + + + {{include "/includes/header.html" ""}} @@ -181,4 +182,4 @@ - \ No newline at end of file + diff --git a/new/download.html b/new/download.html index bc5a259..5c4e359 100644 --- a/new/download.html +++ b/new/download.html @@ -2,8 +2,9 @@ Download Caddy - {{include "/includes/head.html"}} - + {{import "/includes/head.html"}} + {{template "head"}} +
@@ -21,4 +22,4 @@ {{include "/includes/footer.html"}} - \ No newline at end of file + diff --git a/new/features.html b/new/features.html index a7b10e6..bd457f9 100644 --- a/new/features.html +++ b/new/features.html @@ -2,9 +2,10 @@ All features of the Caddy Web Server - {{include "/includes/head.html"}} - - + {{import "/includes/head.html"}} + {{template "head"}} + +
@@ -1722,4 +1723,4 @@ {{include "/includes/footer.html"}} - \ No newline at end of file + diff --git a/new/includes/head.html b/new/includes/head.html index 233c531..28bd27f 100644 --- a/new/includes/head.html +++ b/new/includes/head.html @@ -1,3 +1,11 @@ +{{define "cacheBust" -}} + {{- if fileExists "/.commit-hash" -}} + {{- $commitHash := (include "/.commit-hash") -}} + {{- trim (printf "?v=%v" $commitHash) -}} + {{- end -}} +{{- end}} + +{{define "head"}} @@ -46,5 +54,7 @@ --> - + + + +{{end}} diff --git a/new/index.html b/new/index.html index 851c531..6a9958c 100644 --- a/new/index.html +++ b/new/index.html @@ -2,14 +2,14 @@ Caddy - The Ultimate Server with Automatic HTTPS - {{include "/includes/head.html"}} + {{import "/includes/head.html"}} + {{template "head"}} + + + - - - - - - + + @@ -821,4 +821,4 @@ reverse_proxy /api/* localhost:9002 }); - \ No newline at end of file + diff --git a/new/sponsor.html b/new/sponsor.html index 984ca24..79dc848 100644 --- a/new/sponsor.html +++ b/new/sponsor.html @@ -2,9 +2,10 @@ Sponsor the Caddy Project - {{include "/includes/head.html"}} - - + {{import "/includes/head.html"}} + {{template "head"}} + +
@@ -676,4 +677,4 @@ cardsContainer.addEventListener("pointermove", applyOverlayMask); - \ No newline at end of file + diff --git a/src/business.html b/src/business.html index 96c0e31..68567e2 100644 --- a/src/business.html +++ b/src/business.html @@ -4,7 +4,7 @@ Caddy for Business {{import "/includes/head.html"}} {{template "head"}} - + diff --git a/src/includes/head.html b/src/includes/head.html index a7d7e87..e09cd9a 100644 --- a/src/includes/head.html +++ b/src/includes/head.html @@ -49,9 +49,10 @@ -{{end}} - + +{{end}} +