Skip to content

Instantly share code, notes, and snippets.

@svrist
Created March 16, 2016 20:30
Show Gist options
  • Select an option

  • Save svrist/23f468bf9bf87dec3c3d to your computer and use it in GitHub Desktop.

Select an option

Save svrist/23f468bf9bf87dec3c3d to your computer and use it in GitHub Desktop.

Revisions

  1. svrist created this gist Mar 16, 2016.
    18 changes: 18 additions & 0 deletions galleryimage
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    {{ $suffix := or (.Get "suffix") "jpg" }}
    {{ $size := or (.Get "size") "150x150" }}
    {{ with .Get "file" }}
    <dl class="gallery-item">
    <dt class="gallery-icon landscape">
    <a href="PREFIX/{{ . }}.{{ $suffix }}" data-lightbox="set1"
    data-title="{{ $.Get "caption" }}" >
    <img
    src="PREFIX/{{ . }}-{{ $size }}.{{ $suffix }}"
    itemprop="thumbnail"
    alt="{{ $.Get "caption" }}" />
    </a>
    <dt>
    <dd class='wp-caption-text gallery-caption'>
    {{ $.Get "caption" }}
    </dd>
    </dl>
    {{ end }}