Merge pull request #47376 from dipesh-rawat/cleanup-click-to-zoom

Refactor click-to-zoom option in figure shortcode to align with vanilla Docsy
pull/47381/head
Kubernetes Prow Robot 2024-08-07 02:40:51 -07:00 committed by GitHub
commit b469956848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 -}}