Added image viewer

This commit is contained in:
2020-11-08 14:49:15 +01:00
parent eaba241b14
commit ca65e84af8
6 changed files with 100 additions and 36 deletions
+72
View File
@@ -0,0 +1,72 @@
{{ $style := resources.Get "simplelightbox/simple-lightbox.min.css" }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
<style>
* {
box-sizing: border-box;
}
.container .gallery a img {
float: left;
width: 10%;
height: auto;
border: 2px solid #fff;
-webkit-transition: -webkit-transform .15s ease;
-moz-transition: -moz-transform .15s ease;
-o-transition: -o-transform .15s ease;
-ms-transition: -ms-transform .15s ease;
transition: transform .15s ease;
position: relative;
}
.clear {
clear: both;
}
a {
color: #009688;
text-decoration: none;
}
a:hover {
color: #01695f;
text-decoration: none;
}
</style>
<div class="container">
<h1 class="f2">
Bilder des Tages
</h1>
<div class="gallery">
{{ $page := . }}
{{ with .Resources.Match "images/*" }}
{{ range . }}
{{ $gallary_img := .Fill "300x300" }}
{{ $text := "" }}
{{ if isset $page.Params "captions" }}
{{ range first 1 (where $page.Params.captions "name" .Name) }}
{{ $text = .text }}
{{ end }}
{{ end }}
<a href="{{.Permalink}}">
<img style="max-width: 100%; width: auto; height: auto;" src="{{ $gallary_img.RelPermalink }}"
width="{{ .Width }}" height="{{ .Height }}" alt="{{ .Title }}" title={{ $text }}>
</a>
{{ end }}
{{ end }}
<div class="clear"></div>
</div>
</div>
{{ $js := resources.Get "simplelightbox/simple-lightbox.min.js" }}
<script src="{{ $js.Permalink }}"></script>
<script>
(function() {
var $gallery = new SimpleLightbox('.gallery a', {});
})();
</script>
-1
View File
@@ -3,7 +3,6 @@
<a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.BaseURL }}" >
&copy; {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} {{ now.Format "2006"}} {{ end }}
</a>
<div class="white-40 pv2">Generiert am {{ .PublishDate.Format "2.1.2006 15:04:05" }}</div>
<div>{{ partial "social-follow.html" . }}</div>
</div>