mirror of
https://github.com/Smaug123/static-site-pipeline
synced 2025-10-10 02:09:00 +00:00
Tromso
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
<details>
|
||||
{{ $summary := default "Click to view gallery" (.Get "summary") }}
|
||||
<summary>{{ $summary }}</summary>
|
||||
<div class="gallery">
|
||||
{{ $base := .Get "src" }}
|
||||
{{ $path := print "static/" (.Get "src") }}
|
||||
@@ -7,7 +10,7 @@
|
||||
{{- $isthumb := .Name | findRE ($thumbext | printf "%s\\.") }}<!-- is the current file a thumbnail image? -->
|
||||
{{- $isimg := lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp)" }}<!-- is the current file an image? -->
|
||||
{{- if and $isimg (not $isthumb) }}
|
||||
{{- $thumb := .Name | replaceRE "(\\.)" ($thumbext | printf "%s.") }}
|
||||
{{- $thumb := .Name | replaceRE "(\\.[^.]+)" ($thumbext | printf "%s.jpg") }}
|
||||
{{- $alttextfile := .Name | replaceRE "(\\..+)" ".md" }}
|
||||
{{- $alttext := printf "%s/%s" $path $alttextfile | os.ReadFile }}
|
||||
<a data-fancybox="gallery" href="/{{ $base }}/{{ .Name }}">
|
||||
@@ -15,4 +18,5 @@
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
Reference in New Issue
Block a user