mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
erge branch 'dev' into feature-shortcode-slider
This commit is contained in:
@@ -45,4 +45,11 @@
|
||||
{{ if .Page.HasShortcode "typeit" }}
|
||||
{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" }}
|
||||
<script defer src="{{ $typeitLib.RelPermalink }}" integrity="{{ $typeitLib.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{/* Packery */}}
|
||||
{{ if .Page.HasShortcode "gallery" }}
|
||||
{{ $packeryLib := resources.Get "lib/packery/packery.pkgd.min.js" }}
|
||||
<script defer src="{{ $packeryLib.RelPermalink }}" integrity="{{ $packeryLib.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
18
layouts/shortcodes/gallery.html
Normal file
18
layouts/shortcodes/gallery.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{ $time := now.UnixNano }}
|
||||
{{ $id := delimit (slice "gallery" $time) "-" }}
|
||||
|
||||
<div id="{{ $id }}">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var elem = document.querySelector('#{{ $id }}');
|
||||
var pckry = new Packery(elem, {
|
||||
percentPosition: true,
|
||||
gutter: 5,
|
||||
resize: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user