Skip to content

Commit d4f8e35

Browse files
committed
layouts/images: allow opt-out from lightbox
Authors can now pass `lightbox=false` as a query parameter with their image URL to disable the lightbox effect; this is especially useful for smaller images that do not have a lot of detail. Signed-off-by: Luca Zeuch <[email protected]>
1 parent 2bcebc3 commit d4f8e35

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

layouts/_default/_markup/render-image.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
{{- end }}
110110

111111
{{- $lightbox := true }}
112+
{{- if $u.RawQuery }}
113+
{{- if $u.Query.Has "lightbox" }}
114+
{{- $lightbox = ne ($u.Query.Get "lightbox") "false" }}
115+
{{- end }}
116+
{{- end }}
112117

113118
{{- /* Render image element. */ -}}
114119
{{- if $lightbox -}}

0 commit comments

Comments
 (0)