# render-image.html
{{- if and (ne .Page.Kind "section") (.Page.Section ) }}
<!-- Generate a unique id for each image --> {{- $random := (substr (md5 .Destination) 0 5) }}
<inputtype="checkbox"id="zoomCheck-{{$random}}"hidden><labelfor="zoomCheck-{{$random}}"><imgclass="zoomCheck"loading="lazy"decoding="async"src="{{ .Destination | safeURL }}"alt="{{ .Text }}"{{with.Title}}title="{{ . }}"{{end}}/></label>{{- else }}
<imgloading="lazy"decoding="async"src="{{ .Destination | safeURL }}"alt="{{ .Text }}"{{with.Title}}title="{{ . }}"{{end}}/>{{- end }}
# extend_footer.html
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/medium-zoom/1.0.6/medium-zoom.min.js"integrity="sha512-N9IJRoc3LaP3NDoiGkcPa4gG94kapGpaA5Zq9/Dr04uf5TbLFU5q0o8AbRhLKUUlp8QFS2u7S+Yti0U7QtuZvQ=="crossorigin="anonymous"referrerpolicy="no-referrer"></script><script>constimages=Array.from(document.querySelectorAll(".post-content img"));images.forEach(img=>{mediumZoom(img,{margin:20,/* The space outside the zoomed image */scrollOffset:40,/* The number of pixels to scroll to close the zoom */container:null,/* The viewport to render the zoom in */template:null,/* The template element to display on zoom */background:'rgba(0, 0, 0, 0.8)'});});</script><!-- https://ionic.io/ionicons --><scripttype="module"src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script><scriptnomodulesrc="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>