mirror of
https://github.com/caddyserver/website.git
synced 2025-04-23 05:26:16 -04:00
Implement cache busting
This commit is contained in:
parent
254e415a61
commit
2aa6cd48e1
17 changed files with 85 additions and 56 deletions
|
@ -1,12 +1,20 @@
|
|||
{{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">
|
||||
|
||||
<link rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin />
|
||||
|
||||
<link rel="icon" href="/resources/images/favicon.png">
|
||||
<link rel="icon" href="/resources/images/favicon.png{{template "cacheBust"}}">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:400,700|Maven+Pro:400,700,900|Montserrat:400,700|PT+Mono&display=swap">
|
||||
<link rel="stylesheet" href="/resources/css/common.css">
|
||||
<script src="/resources/js/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/css/common.css{{template "cacheBust"}}">
|
||||
<script src="/resources/js/common.js{{template "cacheBust"}}"></script>
|
||||
|
||||
<!-- General metatags -->
|
||||
<meta name="author" content="Caddy Web Server">
|
||||
|
@ -41,3 +49,4 @@
|
|||
<!-- 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}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue