Skip to content

Commit

Permalink
Merge pull request #47376 from dipesh-rawat/cleanup-click-to-zoom
Browse files Browse the repository at this point in the history
Refactor click-to-zoom option in figure shortcode to align with vanilla Docsy
  • Loading branch information
k8s-ci-robot authored Aug 7, 2024
2 parents bae74ae + da44bfa commit b469956
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
11 changes: 11 additions & 0 deletions layouts/partials/hooks/head-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

0 comments on commit b469956

Please sign in to comment.