File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!-- Checks if page is part of section and page is not section itself -->
2+ {{- if and (ne .Page.Kind "section") (.Page.Section ) }}
3+ <!-- Generate a unique id for each image -->
4+ {{- $random := (substr (md5 .Destination) 0 5) }}
5+ < input type ="checkbox " id ="zoomCheck-{{$random}} " hidden >
6+ < label for ="zoomCheck-{{$random}} ">
7+ < img class ="zoomCheck " loading ="lazy " decoding ="async "
8+ src ="{{ .Destination | safeURL }} " alt ="{{ .Text }} "
9+ {{ with.Title}} title ="{{ . }} " {{ end }} />
10+ </ label >
11+ {{- else }}
12+ < img loading ="lazy " decoding ="async " src ="{{ .Destination | safeURL }} "
13+ alt ="{{ .Text }} " {{ with .Title}} title ="{{ . }} " {{ end }} />
14+ {{- end }}
Original file line number Diff line number Diff line change 1+ < style >
2+ @media screen and (min-width : 769px ) {
3+ /* .post-content is a class which will be present only on single pages
4+ and not lists and section pages in Hugo */
5+ .page-content input [type = "checkbox" ]: checked ~ label > img {
6+ transform : scale (1.6 );
7+ cursor : zoom-out;
8+ position : relative;
9+ z-index : 999 ;
10+ }
11+
12+ .page-content img .zoomCheck {
13+ transition : transform 0.15s ease;
14+ z-index : 999 ;
15+ cursor : zoom-in;
16+ }
17+ }
18+ </ style >
You can’t perform that action at this time.
0 commit comments