Re-add cache busting

Fix docs
This commit is contained in:
Francis Lavoie 2023-11-19 06:28:06 -05:00
parent 09b9c74bfc
commit 5e93103dce
No known key found for this signature in database
GPG key ID: 0F66EE1687682239
8 changed files with 46 additions and 31 deletions

View file

@ -2,15 +2,16 @@
<html>
<head>
<title>Caddy Documentation</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/docs.css">
<link rel="stylesheet" href="/resources/css/docs-home.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/docs.css{{template "cacheBust"}}">
<link rel="stylesheet" href="/resources/css/docs-home.css{{template "cacheBust"}}">
<!-- <meta property="og:title" content="Caddy 2 - The Ultimate Server with Automatic HTTPS">
<meta name="twitter:title" value="Caddy 2 - The Ultimate Server with Automatic HTTPS"> -->
<script src="/resources/js/vendor/marked.min.js"></script>
<script src="/resources/js/docs.js"></script>
<script src="/resources/js/docs-home.js"></script>
<script src="/resources/js/vendor/marked.min.js{{template "cacheBust"}}"></script>
<script src="/resources/js/docs.js{{template "cacheBust"}}"></script>
<script src="/resources/js/docs-home.js{{template "cacheBust"}}"></script>
</head>
<body>
{{include "/includes/header.html" ""}}

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Download Caddy</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/download.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/download.css{{template "cacheBust"}}">
</head>
<body>
<div class="hero">

View file

@ -2,9 +2,10 @@
<html>
<head>
<title>All features of the Caddy Web Server</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/marketing.css">
<link rel="stylesheet" href="/resources/css/features.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/marketing.css{{template "cacheBust"}}">
<link rel="stylesheet" href="/resources/css/features.css{{template "cacheBust"}}">
</head>
<body>
<div class="hero">

View file

@ -1,3 +1,11 @@
{{define "cacheBust" -}}
{{- if fileExists "/.commit-hash" -}}
{{- $commitHash := (include "/.commit-hash") -}}
{{- trim (printf "?v=%v" $commitHash) -}}
{{- end -}}
{{- end}}
{{define "head"}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -46,5 +54,7 @@
</script> -->
<!-- Alpine.js to augment markdown docs -->
<!-- <script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script> -->
<script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
{{end}}

View file

@ -2,14 +2,14 @@
<html>
<head>
<title>Caddy - The Ultimate Server with Automatic HTTPS</title>
{{include "/includes/head.html"}}
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/vendor/asciinema-player-3.6.1.css{{template "cacheBust"}}">
<script src="/resources/js/vendor/asciinema-player-3.6.1.min.js{{template "cacheBust"}}"></script>
<script src="/resources/js/home.js{{template "cacheBust"}}"></script>
<link rel="stylesheet" href="/resources/css/vendor/asciinema-player-3.6.1.css">
<script src="/resources/js/vendor/asciinema-player-3.6.1.min.js"></script>
<script src="/resources/js/home.js"></script>
<link rel="stylesheet" href="/resources/css/marketing.css">
<link rel="stylesheet" href="/resources/css/home.css">
<link rel="stylesheet" href="/resources/css/marketing.css{{template "cacheBust"}}">
<link rel="stylesheet" href="/resources/css/home.css{{template "cacheBust"}}">
<!-- <meta property="og:title" content="Caddy 2 - The Ultimate Server with Automatic HTTPS">
<meta name="twitter:title" value="Caddy 2 - The Ultimate Server with Automatic HTTPS"> -->

View file

@ -2,9 +2,10 @@
<html>
<head>
<title>Sponsor the Caddy Project</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/marketing.css">
<link rel="stylesheet" href="/resources/css/sponsor.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/marketing.css{{template "cacheBust"}}">
<link rel="stylesheet" href="/resources/css/sponsor.css{{template "cacheBust"}}">
</head>
<body>
<div class="hero">

View file

@ -4,7 +4,7 @@
<title>Caddy for Business</title>
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/business.css">
<link rel="stylesheet" href="/resources/css/business.css{{template "cacheBust"}}">
<meta property="og:title" content="Caddy 2 for Business">
<meta name="twitter:title" value="Caddy 2 for Business">
</head>

View file

@ -49,9 +49,10 @@
<!-- Alpine.js to augment markdown docs -->
<script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
{{end}}
<!-- TODO: These don't work -- color values need to be tweaked if they do work -- I think because background-color is set on the body. -->
<meta name="theme-color" content="#123245" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#123245" media="(prefers-color-scheme: dark)">
{{end}}