mirror of
https://github.com/yuzu-emu/shared-bulma-theme
synced 2024-11-26 17:08:03 +00:00
Added imgs shortcode. Added gallery to entry/single page.
This commit is contained in:
parent
a5730798f1
commit
2b4825668a
2 changed files with 30 additions and 0 deletions
|
@ -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 }}
|
16
layouts/shortcodes/imgs.html
Normal file
16
layouts/shortcodes/imgs.html
Normal 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>
|
Loading…
Reference in a new issue