mirror of
https://github.com/caddyserver/website.git
synced 2025-04-25 06:26:17 -04:00
Implement cache busting (#337)
This commit is contained in:
parent
254e415a61
commit
c66f785fcb
17 changed files with 85 additions and 56 deletions
|
@ -1,5 +1,8 @@
|
|||
{{include "/includes/head.html"}}
|
||||
<link rel="stylesheet" href="/resources/css/account/common.css">
|
||||
<script src="/resources/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="/resources/js/sweetalert.min.js"></script>
|
||||
<script src="/resources/js/account/common.js"></script>
|
||||
{{define "account-head"}}
|
||||
{{import "/includes/head.html"}}
|
||||
{{template "head"}}
|
||||
<link rel="stylesheet" href="/resources/css/account/common.css{{template "cacheBust"}}">
|
||||
<script src="/resources/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="/resources/js/sweetalert.min.js"></script>
|
||||
<script src="/resources/js/account/common.js{{template "cacheBust"}}"></script>
|
||||
{{end}}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{{include "/includes/head.html"}}
|
||||
<link rel="stylesheet" href="/resources/css/docs.css">
|
||||
<link rel="stylesheet" href="/resources/css/chroma.css">
|
||||
{{$directives := list }}
|
||||
{{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}}
|
||||
{{$directives = append $directives ($file | trimSuffix ".md")}}
|
||||
{{define "docs-head"}}
|
||||
{{import "/includes/head.html"}}
|
||||
{{template "head"}}
|
||||
<link rel="stylesheet" href="/resources/css/docs.css{{template "cacheBust"}}">
|
||||
<link rel="stylesheet" href="/resources/css/chroma.css{{template "cacheBust"}}">
|
||||
{{$directives := list }}
|
||||
{{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}}
|
||||
{{$directives = append $directives ($file | trimSuffix ".md")}}
|
||||
{{end}}
|
||||
<script type="text/javascript">window.CaddyfileDirectives = {{$directives | toJson}};</script>
|
||||
<script src="/resources/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="/resources/js/docs.js{{template "cacheBust"}}"></script>
|
||||
{{end}}
|
||||
<script type="text/javascript">window.CaddyfileDirectives = {{$directives | toJson}};</script>
|
||||
<script src="/resources/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="/resources/js/docs.js"></script>
|
|
@ -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