mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 16:15:12 +00:00
feat: add explicit fingerprint algo
This commit is contained in:
1 parent
f1c8e66988
commit
127cd7919a
2 files changed
+8
-8
No files matched your search
@@ -3,7 +3,7 @@
|
||||
{{ $mermaid_js := resources.Get "dist/lib/mermaid/mermaid.min.js" }}
|
||||
{{ $mermaid_config_js := resources.Get "js/wowchemy-mermaid-config.js" }}
|
||||
{{ $mermaid_config_js = $mermaid_config_js | resources.Minify }}
|
||||
{{ $mermaid_bundle := slice $mermaid_js $mermaid_config_js | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint }}
|
||||
{{ $mermaid_bundle := slice $mermaid_js $mermaid_config_js | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $mermaid_bundle.RelPermalink }}" integrity="{{ $mermaid_bundle.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
@@ -28,20 +28,20 @@
|
||||
};
|
||||
</script>
|
||||
{{ $markmap_js := resources.Get "dist/lib/markmap/index.js" }}
|
||||
{{ $markmap_js = $markmap_js | resources.Minify | resources.Fingerprint }}
|
||||
{{ $markmap_js = $markmap_js | resources.Minify | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $markmap_js.RelPermalink }}" integrity="{{ $markmap_js.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{/* Katex */}}
|
||||
{{ if (.Page.HasShortcode "math") | or .Params.math | or site.Params.features.math.enable }}
|
||||
{{ $katex_css := resources.Get "dist/lib/katex/katex.min.css" }}
|
||||
{{ $katex_css = $katex_css | resources.Fingerprint }}
|
||||
{{ $katex_css = $katex_css | resources.Fingerprint "sha256" }}
|
||||
<link type="text/css" rel="stylesheet" href="{{ $katex_css.RelPermalink }}" integrity="{{ $katex_css.Data.Integrity }}" />
|
||||
{{ $katex_js := resources.Get "dist/lib/katex/katex.min.js" }}
|
||||
{{ $katex_js = $katex_js | resources.Fingerprint }}
|
||||
{{ $katex_js = $katex_js | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $katex_js.RelPermalink }}" integrity="{{ $katex_js.Data.Integrity }}"></script>
|
||||
{{ $katex_render_js := resources.Get "dist/lib/katex/auto-render.min.js" }}
|
||||
{{ $katex_render_js = $katex_render_js | resources.Fingerprint }}
|
||||
{{ $katex_render_js = $katex_render_js | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $katex_render_js.RelPermalink }}" integrity="{{ $katex_render_js.Data.Integrity }}" onload="renderMathInElement(document.body);"></script>
|
||||
{{ $katex_fonts := resources.Match "dist/lib/katex/fonts/*" }}
|
||||
{{ range $katex_fonts }}
|
||||
@@ -52,6 +52,6 @@
|
||||
{{/* Plotly */}}
|
||||
{{ if .Page.HasShortcode "chart" }}
|
||||
{{ $plotly_js := resources.Get "dist/lib/plotly/plotly.min.js" }}
|
||||
{{ $plotly_js = $plotly_js | resources.Fingerprint }}
|
||||
{{ $plotly_js = $plotly_js | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $plotly_js.RelPermalink }}" integrity="{{ $plotly_js.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
@@ -54,7 +54,7 @@
|
||||
{{ $styles := resources.Get "css/styles.css" }}
|
||||
{{ $styles = $styles | resources.PostCSS $options }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
|
||||
{{ $styles = $styles | minify | fingerprint "sha256" | resources.PostProcess }}
|
||||
{{ end }}
|
||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||
{{ end }}
|
||||
@@ -289,7 +289,7 @@
|
||||
{{ $js_academic := $js_academic | resources.Minify }}
|
||||
{{ $js_bundle := slice $js_bundle_head $js_academic | resources.Concat (printf "js/wowchemy-%s.min.js" .Lang) }}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{ $js_bundle = $js_bundle | fingerprint "md5" }}
|
||||
{{ $js_bundle = $js_bundle | fingerprint "sha256" }}
|
||||
{{- end -}}
|
||||
<script
|
||||
defer
|
||||
|
||||
Reference in new issue
Block a user