Refine click-to-zoom for Docsy

This commit is contained in:
Dipesh Rawat 2024-08-07 01:00:52 +01:00
parent 926235beb1
commit da44bfa406
No known key found for this signature in database
3 changed files with 11 additions and 5 deletions

View File

@ -91,11 +91,6 @@
<script defer src="{{ "js/release_binaries.js" | relURL }}"></script>
{{- end -}}
<!-- Enable zoom-on-click for figures that opt in to this -->
{{- if .HasShortcode "figure" -}}
<script defer src="{{ "js/zoom.js" | relURL }}"></script>
{{- end -}}
{{- if eq (lower .Params.cid) "community" -}}
{{- if eq .Params.community_styles_migrated true -}}
<link href="/css/community.css" rel="stylesheet"><!-- legacy styles -->

View File

@ -13,3 +13,14 @@
{{- if .HasShortcode "cncf-landscape" -}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.min.js" integrity="sha384-hHTwgxzjpO1G1NI0wMHWQYUxnGtpWyDjVSZrFnDrlWa5OL+DFY57qnDWw/5WSJOl" crossorigin="anonymous"></script>
{{- end -}}
{{- if .HasShortcode "figure" -}}
<!-- Enable zoom-on-click for figures that opt in to this -->
{{- if hugo.IsProduction -}}
{{- $zoomJs := resources.Get "js/zoom.js" | minify | fingerprint -}}
<script defer src="{{ $zoomJs.RelPermalink }}" integrity="{{ $zoomJs.Data.Integrity }}" crossorigin="anonymous"></script>
{{- else -}}
{{- $zoomJs := resources.Get "js/zoom.js" -}}
<script defer src="{{ $zoomJs.RelPermalink }}"></script>
{{- end -}}
{{- end -}}