Added imgs shortcode. Added gallery to entry/single page.

This commit is contained in:
Chris 2018-07-12 23:22:43 -04:00
parent a5730798f1
commit 2b4825668a
2 changed files with 30 additions and 0 deletions

View File

@ -34,4 +34,18 @@
</div>
{{ end }}
{{ end }}
{{ define "css" }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css" type="text/css" />
{{ end }}
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", function() {
baguetteBox.run('.is-img-preview');
});
</script>
{{ end }}

View File

@ -0,0 +1,16 @@
<div class="columns is-img-preview">
{{ range $param := .Params }}
<!-- image -->
{{ $items := split $param "|" }}
{{ $src := (index $items 0) }}
{{ $title := (index $items 1) }}
<div class="column">
<a href="{{ $src }}" title="{{ $title }}">
<img src="{{ $src }}" alt="{{ $title }}">
</a>
{{ if $title }}
<p class="has-text-centered is-italic has-text-grey-light">{{ $title }}</p>
{{ end }}
</div>
{{ end }}
</div>