Import Hugo

This commit is contained in:
Smaug123
2023-09-30 18:30:52 +01:00
parent 85d784d889
commit 1f3e107106
250 changed files with 59591 additions and 48 deletions

View File

@@ -0,0 +1,5 @@
{{- if strings.HasSuffix .Page.Site.BaseURL "/" -}}
{{ .Page.Site.BaseURL }}
{{- else -}}
{{ printf "%s/" .Page.Site.BaseURL }}
{{- end -}}

View 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>

View 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>