mirror of
https://github.com/Smaug123/static-site-pipeline
synced 2025-10-08 01:38:38 +00:00
Import Hugo
This commit is contained in:
5
hugo/layouts/shortcodes/baseurl.html
Normal file
5
hugo/layouts/shortcodes/baseurl.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- if strings.HasSuffix .Page.Site.BaseURL "/" -}}
|
||||
{{ .Page.Site.BaseURL }}
|
||||
{{- else -}}
|
||||
{{ printf "%s/" .Page.Site.BaseURL }}
|
||||
{{- end -}}
|
18
hugo/layouts/shortcodes/foldergallery.html
Normal file
18
hugo/layouts/shortcodes/foldergallery.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="gallery">
|
||||
{{ $base := .Get "src" }}
|
||||
{{ $path := print "static/" (.Get "src") }}
|
||||
|
||||
{{ range (readDir $path) }}
|
||||
{{- $thumbext := "-thumb" }}
|
||||
{{- $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.") }}
|
||||
{{- $alttextfile := .Name | replaceRE "(\\..+)" ".md" }}
|
||||
{{- $alttext := printf "%s/%s" $path $alttextfile | os.ReadFile }}
|
||||
<a data-fancybox="gallery" href="/{{ $base }}/{{ .Name }}">
|
||||
<img src="/{{ $base }}/{{ $thumb }}" width=100 height=100 alt={{ $.Page.RenderString $alttext }}> <br/>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</div>
|
7
hugo/layouts/shortcodes/side.html
Normal file
7
hugo/layouts/shortcodes/side.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<span class="sidenote">
|
||||
<label class="sidenote-label" for="{{ .Get 1 }}"> {{ .Get 2 }}</label>
|
||||
<input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}" />
|
||||
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
||||
{{ .Inner }}
|
||||
</span>
|
||||
</span>
|
Reference in New Issue
Block a user