~dricottone/blog

ref: b6d71d6597e8c942065e419830ebe6aa4f626eec blog/layouts/shortcodes/image.html -rw-r--r-- 622 bytes
b6d71d65Dominic Ricottone Bump jquery version 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div class="image">
  {{ $web_src := print (.Get "src") }}
  {{ if strings.HasSuffix $web_src "webm" }}
    <video controls loop width="200">
      <source src="{{ $web_src }}" type="video/webm">
      <p>Video <a href="{{ $web_src }}">here</a></p>
    </video>
  {{ else if (strings.HasSuffix $web_src "mp4") }}
    <video controls loop width="200">
      <source src="{{ $web_src }}" type="video/mp4">
      <p>Video <a href="{{ $web_src }}">here</a></p>
    </video>
  {{ else }}
    <a href="{{ $web_src }}" data-lightbox="{{ .Page.Title }}">
      <img src="{{ $web_src }}" height="100" />
    </a>
  {{ end}}
</div>