diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-24 15:34:00 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-24 15:34:00 +0300 |
commit | 7e56922f82a165759ba0ed852cdb4479f30bd233 (patch) | |
tree | 71b9d3f9b2ecb259af47f090170e5b028dc1dd40 /layouts | |
parent | ef88651fe4faaa4e94683c822646a6b98667fe1b (diff) |
chore(lib): update mermaid 8.4.2 -> 8.4.8 echarts 4.5.0 -> 4.6.0 gitalk 1.5.0 -> 1.6.0
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/head/link.html | 12 | ||||
-rw-r--r-- | layouts/partials/script.html | 15 |
2 files changed, 15 insertions, 12 deletions
diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html index c8ff62b..9b007ec 100644 --- a/layouts/partials/head/link.html +++ b/layouts/partials/head/link.html @@ -25,16 +25,16 @@ {{- with $CDN.fontawesomeFreeCSS -}} {{- . | safeHTML -}} {{- else -}} - {{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}} - <link rel="stylesheet" href="{{ $res.RelPermalink }}"> + {{- $res := resources.Get "lib/fontawesome-free/all.min.css" | resources.Fingerprint "sha256" -}} + <link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- end -}} {{- /* Animate.css */ -}} {{- with $CDN.animateCSS -}} {{- . | safeHTML -}} {{- else -}} - {{ $res := resources.Get "lib/animate/animate.min.css" -}} - <link rel="stylesheet" href="{{ $res.RelPermalink }}"> + {{ $res := resources.Get "lib/animate/animate.min.css" | resources.Fingerprint "sha256" -}} + <link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- end -}} {{- /* style.min.css */ -}} @@ -43,5 +43,5 @@ {{- $options = dict "includePaths" (slice "config/css") | merge $options -}} {{- $options = dict "outputStyle" "compressed" | merge $options -}} {{- $options = dict "enableSourceMap" true | merge $options -}} -{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}} -<link rel="stylesheet" href="{{ $res.RelPermalink }}"> +{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options | resources.Fingerprint "sha256" -}} +<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> diff --git a/layouts/partials/script.html b/layouts/partials/script.html index c3b78ec..9e61182 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -157,7 +157,7 @@ {{- else -}} {{- slice "lib/mermaid/mermaid.min.js" | $scratch.Add "scriptLocal" -}} {{- end -}} - {{- slice "css/mermaid.scss" | $scratch.Add "linkLocal" -}} + {{- slice "lib/mermaid/mermaid.scss" | $scratch.Add "linkLocal" -}} <script> window.mermaidMap = {{ jsonify . | safeJS }}; </script> @@ -210,6 +210,10 @@ {{- end -}} {{- end -}} +{{- /* Theme script */ -}} +{{- slice "js/theme.min.js" | $scratch.Add "scriptLocal" -}} +{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}} + {{- range $scratch.Get "linkCDN" -}} {{- safeHTML . -}} {{- end -}} @@ -221,7 +225,8 @@ {{- else if not (strings.HasSuffix . ".min.css") -}} {{- $res = minify $res -}} {{- end -}} - <link rel="stylesheet" href="{{ $res.RelPermalink }}"> + {{- $res = $res | resources.Fingerprint "sha256" -}} + <link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- end -}} {{- range $scratch.Get "scriptCDN" -}} @@ -232,12 +237,10 @@ {{- if not (strings.HasSuffix . ".min.js") -}} {{- $res = minify $res -}} {{- end -}} - <script src="{{ $res.RelPermalink }}"></script> + {{- $res = $res | resources.Fingerprint "sha256" -}} + <script src="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"></script> {{- end -}} -{{- /* Theme script */ -}} -<script src=/js/theme.min.js></script> - {{- /* Google analytics async */ -}} {{- if $scratch.Get "production" | and .Site.GoogleAnalytics -}} {{- template "_internal/google_analytics_async.html" . -}} |