primo fix foldergallery #143
@ -28,19 +28,16 @@
|
||||
<link rel="stylesheet" href="/js/jquery.fancybox.3.5.7.min.css" />
|
||||
|
||||
<div class="gallery">
|
||||
{{ $path := print "content/gallery/" (.Get "src") }}
|
||||
{{ $url := print (.Get "src") }}
|
||||
{{ range (readDir $path) }}
|
||||
{{/* don't try to display .DS_Store or directories */}}
|
||||
{{ if and (ne .Name ".DS_Store") (not .IsDir) }}
|
||||
{{ $src := print "/it/gallery" "/" $url "/" .Name }}
|
||||
{{/*
|
||||
troubleshoot the $src variable as needed
|
||||
<!-- <p>{{ $src }}</p> -->
|
||||
*/}}
|
||||
<a data-fancybox="gallery" data-caption="{{ .Name }}" href="{{ $src }}">
|
||||
<img src="{{ $src }}"> <br/>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- range (.Page.Resources.ByType "image") -}}
|
||||
{{- $big := .Resize "x1600 webp q85" -}}
|
||||
{{- $mid := .Resize "x1080 webp q80" -}}
|
||||
{{- $sml := .Resize "x480 webp q70" -}}
|
||||
{{- $thumb := .Resize "x200 webp q50" -}}
|
||||
<a data-fancybox="gallery" data-type="image"
|
||||
data-caption="{{ .Title }}"
|
||||
data-srcset="{{ $big.RelPermalink }} {{ $big.Width }}w, {{ $mid.RelPermalink }} {{ $mid.Width }}w, {{ $sml.RelPermalink }} {{ $sml.Width }}w"
|
||||
href="{{ $big.RelPermalink }}">
|
||||
<img src="{{ $thumb.RelPermalink }}" alt="">
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user