Add baguettebox view

This commit is contained in:
CaptV0rt3x 2020-05-22 19:53:47 +05:30
parent 43f8303fab
commit a5b9214a47
2 changed files with 14 additions and 1 deletions

View File

@ -116,6 +116,15 @@
</div>
<script src="{{ .Site.BaseURL }}/js/script.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css" type="text/css" />
<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>
{{ block "scripts" . }}{{ end }}
{{ if in .Params.js "juxtapose" }}

View File

@ -6,6 +6,7 @@
<div class="container" style="width: 100%;">
{{ $.Scratch.Set "size" (div 12 (len $figures)) }}
<div class="is-img-preview">
{{ range $figure := $figures }}
{{ $.Scratch.Set "src" (index (split $figure "=") 0) }}
{{ $.Scratch.Set "title" (index (split $figure "=") 1) }}
@ -20,7 +21,9 @@
</video>
</div>
{{ else if eq $type "image" }}
<img src="{{ printf "%s%s" $path ($.Scratch.Get "src") }}" alt="{{ $.Scratch.Get "title" }}" />
<a href="{{ printf "%s%s" $path ($.Scratch.Get "src") }}" title="{{ $.Scratch.Get "title" }}">
<img src="{{ printf "%s%s" $path ($.Scratch.Get "src") }}" alt="{{ $.Scratch.Get "title" }}" />
</a>
{{ else if eq $type "imagelink" }}
<a href="{{ $.Scratch.Get "link" }}" style="border-bottom-style: none;" >
<img src="{{ printf "%s%s" $path ($.Scratch.Get "src") }}" alt="{{ $.Scratch.Get "title" }}" />
@ -34,4 +37,5 @@
</figure>
</div>
{{ end }}
</div>
</div>