Skip to content

Instantly share code, notes, and snippets.

@jsonbecker
Last active December 31, 2019 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsonbecker/d7e57ec8e928de5cac01834a3aaee9eb to your computer and use it in GitHub Desktop.
Save jsonbecker/d7e57ec8e928de5cac01834a3aaee9eb to your computer and use it in GitHub Desktop.
GLightbox shortcode
<a href="{{ .Get "src" }}"
class="glightbox"
{{ if .Get "gallery"}}
data-gallery="{{ .Get "gallery" }}"
{{ end }}
{{ if or (.Get "title") (.Get "description") }}
data-glightbox="title:{{ .Get "title" | default "" }};description:{{ .Get "description" | default "" }}"
{{end}}
>
<img src="{{ .Get "src" }}"
{{ if .Get "alt" }}
alt="{{ .Get "alt" }}"
{{ end }}
{{ if .Get "title" }}
title={{ .Get "title" }}
{{ end }}
style="max-width: 100%"/>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment