chore: convert to Unix line breaks

This commit is contained in:
Sören Weber 2025-02-16 00:03:08 +01:00
parent f9d00be7b4
commit a0cb9ffcb1
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
17 changed files with 390 additions and 389 deletions

View file

@ -1,14 +1,15 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 9999
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 9999
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

16
.gitignore vendored
View file

@ -1,8 +1,8 @@
.DS_Store
.githooks/hooks.log
.hugo_build.lock
docs/public*
exampleSite/public*
hugo*.exe
*.xcf
*.zip
.DS_Store
.githooks/hooks.log
.hugo_build.lock
docs/public*
exampleSite/public*
hugo*.exe
*.xcf
*.zip

View file

@ -1,22 +1,22 @@
assets/css/chroma*.css
assets/css/variables.css
assets/_relearn_searchindex.js
docs/.frontmatter
docs/content
docs/layouts
docs/static
docs/frontmatter.json
exampleSite
layouts
static/css/auto-complete.css
static/css/*.min.css
static/css/swagger*.css
static/js/d3
static/js/lunr
static/js/mathjax
static/js/swagger-ui
static/js/auto-complete.js
static/js/*.min.js
*.md
*.yaml
*.yml
assets/css/chroma*.css
assets/css/variables.css
assets/_relearn_searchindex.js
docs/.frontmatter
docs/content
docs/layouts
docs/static
docs/frontmatter.json
exampleSite
layouts
static/css/auto-complete.css
static/css/*.min.css
static/css/swagger*.css
static/js/d3
static/js/lunr
static/js/mathjax
static/js/swagger-ui
static/js/auto-complete.js
static/js/*.min.js
*.md
*.yaml
*.yml

View file

@ -1,3 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
{
"recommendations": ["esbenp.prettier-vscode"]
}

40
.vscode/settings.json vendored
View file

@ -1,20 +1,20 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"extensions.ignoreRecommendations": false,
"prettier.useEditorConfig": true,
"spellright.documentTypes": ["latex", "markdown"],
"spellright.language": ["en"]
}
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"extensions.ignoreRecommendations": false,
"prettier.useEditorConfig": true,
"spellright.documentTypes": ["latex", "markdown"],
"spellright.language": ["en"]
}

View file

@ -1,29 +1,29 @@
+++
description = 'Launch Day'
title = 'Day 1'
weight = 1
+++
## Launch Day
**Captains Log, 0120 hours**
> ***"No mission too saucy for us!"***
> Captains official decree
It seems we accidentally loaded a crate of rubber chickens instead of emergency food rations, but the crew is already brainstorming new dance routines with them. Meanwhile, our quartermaster replaced the lifebuoys with giant doughnuts for a "themed" departure—perfect for dunking our morale into sugary bliss.
### Status
- **Reason for voyage:** A midnight run to deliver top-secret cargo (pasta flour and extra marinara).
- **Crew status:**
- Eager to set sail
- Full of energy (and possibly leftover breadsticks)
### Early Observations
The moonlit sky casts {{% badge style="primary" icon="anchor" %}}The Purple Pulpo{{% /badge %}} in a mysterious glow. Rumor has it, our **octopus figurehead** twitched its wooden tentacles twice, a good omen for our daring spaghetti mission. Some say those tentacles can sense hidden spice routes.
---
Stay tuned for [more updates](second-day) from our floating festival of noodles and nautical nonsense.
+++
description = 'Launch Day'
title = 'Day 1'
weight = 1
+++
## Launch Day
**Captains Log, 0120 hours**
> ***"No mission too saucy for us!"***
> Captains official decree
It seems we accidentally loaded a crate of rubber chickens instead of emergency food rations, but the crew is already brainstorming new dance routines with them. Meanwhile, our quartermaster replaced the lifebuoys with giant doughnuts for a "themed" departure—perfect for dunking our morale into sugary bliss.
### Status
- **Reason for voyage:** A midnight run to deliver top-secret cargo (pasta flour and extra marinara).
- **Crew status:**
- Eager to set sail
- Full of energy (and possibly leftover breadsticks)
### Early Observations
The moonlit sky casts {{% badge style="primary" icon="anchor" %}}The Purple Pulpo{{% /badge %}} in a mysterious glow. Rumor has it, our **octopus figurehead** twitched its wooden tentacles twice, a good omen for our daring spaghetti mission. Some say those tentacles can sense hidden spice routes.
---
Stay tuned for [more updates](second-day) from our floating festival of noodles and nautical nonsense.

View file

@ -1,32 +1,32 @@
+++
description = 'At Sea'
title = 'Day 2'
weight = 2
+++
## At Sea
**Captains Log, 0545 hours**
> ***"A little sea spray cant break our spirit—nor our appetite!"***
> The Chef, after a minor sauce-spill incident
The waves crash and the crew awakens to the salty sea breeze. Our beloved ship, {{% badge style="primary" icon="anchor" %}}The Purple Pulpo{{% /badge %}}, plows forward, determined to complete our "Operation Squid Spaghetti."
### Status
- **Weather:** Slightly stormy with a touch of dramatic sea mist
- **Crew Morale:**
1. Excitement level: High
2. Hunger level: *Astronomical*
3. Willingness to sing shanties: ∞
### Culinary Update
The kitchen rattles with every wave, saucepans clanging like a symphony of disorganized percussion. Marinara overboard? Twice.
But fear not, the crew valiantly rescued the floating ladle, dubbing it **Sir Stir-a-Lot**.
---
Stay tuned for the [next thrilling entry](third-day): How fresh noodles fare in gale-force winds... and whether the sauce can hold up against the unstoppable appetite of seafaring sailors!
+++
description = 'At Sea'
title = 'Day 2'
weight = 2
+++
## At Sea
**Captains Log, 0545 hours**
> ***"A little sea spray cant break our spirit—nor our appetite!"***
> The Chef, after a minor sauce-spill incident
The waves crash and the crew awakens to the salty sea breeze. Our beloved ship, {{% badge style="primary" icon="anchor" %}}The Purple Pulpo{{% /badge %}}, plows forward, determined to complete our "Operation Squid Spaghetti."
### Status
- **Weather:** Slightly stormy with a touch of dramatic sea mist
- **Crew Morale:**
1. Excitement level: High
2. Hunger level: *Astronomical*
3. Willingness to sing shanties: ∞
### Culinary Update
The kitchen rattles with every wave, saucepans clanging like a symphony of disorganized percussion. Marinara overboard? Twice.
But fear not, the crew valiantly rescued the floating ladle, dubbing it **Sir Stir-a-Lot**.
---
Stay tuned for the [next thrilling entry](third-day): How fresh noodles fare in gale-force winds... and whether the sauce can hold up against the unstoppable appetite of seafaring sailors!

View file

@ -1,31 +1,31 @@
+++
description = 'Island Arrival'
title = 'Day 3'
weight = 3
+++
## Island Arrival
**Captains Log, 1140 hours**
> ***"Ahoy, pasta-lovers! Our mission is finally a sauce-cess!"***
> The Enthused Quartermaster
The sun blazes overhead, revealing an island coastline shaped like a **questionable noodle bowl** — the perfect destination for our midnight pasta cargo.
### Status
- Purple sails flutter in the island breeze
- The octopus figurehead is **oddly** shining—some claim the wooden tentacles are still dancing to an unseen rhythm
- *Slight tang* of marinara lingers across the entire deck
### Incident in the Crow's Nest
Upon our arrival in the harbor, the lookout nearly toppled from his perch in a fit of excitement. A mysterious figure on the dock signaled with a lantern three times—followed by a deafening call of a heron in flight.
The lookout swears the bird cawed in perfect Morse code, as if warning us of impending calamity. Moments later, a sudden gust toppled the spyglass stand, sending it clattering down to the quarterdeck, just as the heron sped off with a triumphant whistle.
> [!primary]+ Mission Debriefing
> - [x] Crates of sauce offloaded with care (and the occasional accidental slosh)
> - [x] Crowds of locals, excited for fresh spaghetti
> - [ ] _Squid ink_ banner hoisted high to announce “Operation Squid Spaghetti Complete”
+++
description = 'Island Arrival'
title = 'Day 3'
weight = 3
+++
## Island Arrival
**Captains Log, 1140 hours**
> ***"Ahoy, pasta-lovers! Our mission is finally a sauce-cess!"***
> The Enthused Quartermaster
The sun blazes overhead, revealing an island coastline shaped like a **questionable noodle bowl** — the perfect destination for our midnight pasta cargo.
### Status
- Purple sails flutter in the island breeze
- The octopus figurehead is **oddly** shining—some claim the wooden tentacles are still dancing to an unseen rhythm
- *Slight tang* of marinara lingers across the entire deck
### Incident in the Crow's Nest
Upon our arrival in the harbor, the lookout nearly toppled from his perch in a fit of excitement. A mysterious figure on the dock signaled with a lantern three times—followed by a deafening call of a heron in flight.
The lookout swears the bird cawed in perfect Morse code, as if warning us of impending calamity. Moments later, a sudden gust toppled the spyglass stand, sending it clattering down to the quarterdeck, just as the heron sped off with a triumphant whistle.
> [!primary]+ Mission Debriefing
> - [x] Crates of sauce offloaded with care (and the occasional accidental slosh)
> - [x] Crowds of locals, excited for fresh spaghetti
> - [ ] _Squid ink_ banner hoisted high to announce “Operation Squid Spaghetti Complete”

View file

@ -1,6 +1,6 @@
+++
description = 'Launch Day'
title = 'Day 1'
weight = 1
+++
+++
description = 'Launch Day'
title = 'Day 1'
weight = 1
+++
{{< piratify >}}

View file

@ -1,7 +1,7 @@
+++
description = 'At Sea'
title = 'Day 2'
weight = 2
+++
+++
description = 'At Sea'
title = 'Day 2'
weight = 2
+++
{{< piratify >}}

View file

@ -1,6 +1,6 @@
+++
description = 'Island Arrival'
title = 'Day 3'
weight = 3
+++
+++
description = 'Island Arrival'
title = 'Day 3'
weight = 3
+++
{{< piratify >}}

View file

@ -1,6 +1,6 @@
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- if .RelPermalink -}}
# {{ .Title }}
{{ strings.TrimLeft "\n\r\t " .RawContent | safeHTML }}
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- if .RelPermalink -}}
# {{ .Title }}
{{ strings.TrimLeft "\n\r\t " .RawContent | safeHTML }}
{{- end }}

View file

@ -1,4 +1,4 @@
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- with and .File .File.Filename -}}
{{ readFile . | safeHTML }}
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- with and .File .File.Filename -}}
{{ readFile . | safeHTML }}
{{- end }}

View file

@ -1,57 +1,57 @@
{{- $href := partial "permalink.gotmpl" (dict "to" .linkObject) }}
{{- $silent := .silent | default false }}
{{- $hideFilepath := .hideFilepath | default false }}
{{- $u := urls.Parse .url }}
{{- with $u.RawQuery }}
{{- $href = printf "%s?%s" $href . }}
{{- end }}
{{- with $u.Fragment }}
{{- $href = printf "%s#%s" $href . }}
{{- if not $silent }}
{{- partial "inline/validate-fragment.html" (dict "origPage" $.page "page" $.linkObject "parsedURL" $u "url" $.url "param" $.param "hideFilepath" $hideFilepath) }}
{{- end }}
{{- end }}
{{- return $href }}
{{- define "partials/inline/validate-fragment.html" }}
{{- /*
Validates the fragment portion of a link destination.
*/}}
{{- /* Initialize. */}}
{{- $errorLevel := .errorLevel }}
{{- $origPage := .origPage }}
{{- $p := .page }}
{{- $url := .url }}
{{- $u := .parsedURL }}
{{- $param := .param }}
{{- $hideFilepath := .hideFilepath }}
{{- /* Validate. */}}
{{- with $u.Fragment }}
{{- if $p.Fragments.Identifiers.Contains . }}
{{- if gt ($p.Fragments.Identifiers.Count .) 1 }}
{{- $filepath := "[virtual file]" }}{{ with and $origPage $origPage.File $origPage.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "%q: duplicate heading ID %q found" $filepath . }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" $url "page" $origPage "param" $param "msg" $msg) }}
{{- end }}
{{- else }}
{{- /* Determine target path for warning and error message. */}}
{{- $targetPath := "" }}
{{- with $p.File }}
{{- $targetPath = .Path }}
{{- else }}
{{- $targetPath = .Path }}
{{- end }}
{{- $filepath := "[virtual file]" }}{{ with and $origPage $origPage.File $origPage.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "heading ID %q not found" . }}
{{- if not $hideFilepath }}
{{- $msg = printf "%q: %s" $filepath $msg }}
{{- end }}
{{- if or $hideFilepath (ne $origPage $p) }}
{{- $msg = printf "%s in %q" $msg $targetPath }}
{{- end }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" $url "page" $origPage "param" $param "msg" $msg) }}
{{- end }}
{{- end }}
{{- $href := partial "permalink.gotmpl" (dict "to" .linkObject) }}
{{- $silent := .silent | default false }}
{{- $hideFilepath := .hideFilepath | default false }}
{{- $u := urls.Parse .url }}
{{- with $u.RawQuery }}
{{- $href = printf "%s?%s" $href . }}
{{- end }}
{{- with $u.Fragment }}
{{- $href = printf "%s#%s" $href . }}
{{- if not $silent }}
{{- partial "inline/validate-fragment.html" (dict "origPage" $.page "page" $.linkObject "parsedURL" $u "url" $.url "param" $.param "hideFilepath" $hideFilepath) }}
{{- end }}
{{- end }}
{{- return $href }}
{{- define "partials/inline/validate-fragment.html" }}
{{- /*
Validates the fragment portion of a link destination.
*/}}
{{- /* Initialize. */}}
{{- $errorLevel := .errorLevel }}
{{- $origPage := .origPage }}
{{- $p := .page }}
{{- $url := .url }}
{{- $u := .parsedURL }}
{{- $param := .param }}
{{- $hideFilepath := .hideFilepath }}
{{- /* Validate. */}}
{{- with $u.Fragment }}
{{- if $p.Fragments.Identifiers.Contains . }}
{{- if gt ($p.Fragments.Identifiers.Count .) 1 }}
{{- $filepath := "[virtual file]" }}{{ with and $origPage $origPage.File $origPage.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "%q: duplicate heading ID %q found" $filepath . }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" $url "page" $origPage "param" $param "msg" $msg) }}
{{- end }}
{{- else }}
{{- /* Determine target path for warning and error message. */}}
{{- $targetPath := "" }}
{{- with $p.File }}
{{- $targetPath = .Path }}
{{- else }}
{{- $targetPath = .Path }}
{{- end }}
{{- $filepath := "[virtual file]" }}{{ with and $origPage $origPage.File $origPage.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "heading ID %q not found" . }}
{{- if not $hideFilepath }}
{{- $msg = printf "%q: %s" $filepath $msg }}
{{- end }}
{{- if or $hideFilepath (ne $origPage $p) }}
{{- $msg = printf "%s in %q" $msg $targetPath }}
{{- end }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" $url "page" $origPage "param" $param "msg" $msg) }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -1,79 +1,79 @@
{{- $attributes := .attributes | default dict }}
{{- $height := "auto" }}
{{- $width := "auto" }}
{{- $effects := dict "border" false "dataurl" false "inlinecontent" false "lazy" true "lightbox" true "shadow" false }}
{{- if .page.Site.Params.imageeffects }}
{{- $effects = merge $effects .page.Site.Params.imageeffects }}
{{- end }}
{{- if .page.Params.imageEffects }}
{{- $effects = merge $effects .page.Params.imageEffects }}
{{- end }}
{{- $u := urls.Parse .url }}
{{- if $u.RawQuery }}
{{- if $u.Query.Has "classes" }}
{{- $classes := slice | append (split ($u.Query.Get "classes") ",") }}
{{- range $classes }}
{{- $k := . }}
{{- $v := true }}
{{- if strings.HasPrefix $k "no" }}
{{- $k := strings.TrimPrefix "no" $k }}
{{- $v := false }}
{{- end }}
{{- $effects = merge $effects (dict $k $v) }}
{{- end }}
{{- end }}
{{- if $u.Query.Has "featherlight" }}
{{- $filepath := "[virtual file]" }}{{ with and .page .page.File .page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-11-0" $filepath }}
{{- $effects = merge $effects (dict "lightbox" (ne ($u.Query.Get "featherlight") "false")) }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $effects = merge $effects (dict $k (ne ($u.Query.Get $k) "false")) }}
{{- end }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $paramValue := $u.Query.Get $k }}
{{- $newValue := true }}
{{- if eq $paramValue "" }}
{{- $newValue = true }}
{{- else if eq $paramValue "true" }}
{{- $newValue = true }}
{{- else if eq $paramValue "false" }}
{{- $newValue = false }}
{{- else }}
{{- $newValue = $paramValue }}
{{- end }}
{{- $effects = merge $effects (dict $k $newValue) }}
{{- end }}
{{- end }}
{{- with $u.Query.Get "height" }}
{{- $height = . }}
{{- end }}
{{- with $u.Query.Get "width" }}
{{- $width = . }}
{{- end }}
{{- end }}
{{- $classes := slice }}
{{- range $k, $v := $effects }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- $classes = $classes | append $k }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .linkObject $effects.inlinecontent (eq .linkObject.MediaType.Type "image/svg+xml") }}
{{- $content := .linkObject.Content | replaceRE `(?s)^\s*<\?.*?\?>\s*` "" }}
{{- $attributes = merge $attributes (dict "content" $content) }}
{{- else if and .linkObject $effects.dataurl }}
{{- $src := printf "data:%s;base64,%s" .linkObject.MediaType.Type (.linkObject.Content | base64Encode) }}
{{- $attributes = merge $attributes (dict "src" $src) }}
{{- else }}
{{- $attributes = merge $attributes (dict "src" .url) }}
{{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "style" (printf " height: %s; width: %s;%s" $height $width (index $attributes "style" | default ""))) }}
{{- if $effects.lazy }}{{ $attributes = merge $attributes (dict "loading" "lazy") }}{{ end }}
{{- $attributes := .attributes | default dict }}
{{- $height := "auto" }}
{{- $width := "auto" }}
{{- $effects := dict "border" false "dataurl" false "inlinecontent" false "lazy" true "lightbox" true "shadow" false }}
{{- if .page.Site.Params.imageeffects }}
{{- $effects = merge $effects .page.Site.Params.imageeffects }}
{{- end }}
{{- if .page.Params.imageEffects }}
{{- $effects = merge $effects .page.Params.imageEffects }}
{{- end }}
{{- $u := urls.Parse .url }}
{{- if $u.RawQuery }}
{{- if $u.Query.Has "classes" }}
{{- $classes := slice | append (split ($u.Query.Get "classes") ",") }}
{{- range $classes }}
{{- $k := . }}
{{- $v := true }}
{{- if strings.HasPrefix $k "no" }}
{{- $k := strings.TrimPrefix "no" $k }}
{{- $v := false }}
{{- end }}
{{- $effects = merge $effects (dict $k $v) }}
{{- end }}
{{- end }}
{{- if $u.Query.Has "featherlight" }}
{{- $filepath := "[virtual file]" }}{{ with and .page .page.File .page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-11-0" $filepath }}
{{- $effects = merge $effects (dict "lightbox" (ne ($u.Query.Get "featherlight") "false")) }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $effects = merge $effects (dict $k (ne ($u.Query.Get $k) "false")) }}
{{- end }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $paramValue := $u.Query.Get $k }}
{{- $newValue := true }}
{{- if eq $paramValue "" }}
{{- $newValue = true }}
{{- else if eq $paramValue "true" }}
{{- $newValue = true }}
{{- else if eq $paramValue "false" }}
{{- $newValue = false }}
{{- else }}
{{- $newValue = $paramValue }}
{{- end }}
{{- $effects = merge $effects (dict $k $newValue) }}
{{- end }}
{{- end }}
{{- with $u.Query.Get "height" }}
{{- $height = . }}
{{- end }}
{{- with $u.Query.Get "width" }}
{{- $width = . }}
{{- end }}
{{- end }}
{{- $classes := slice }}
{{- range $k, $v := $effects }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- $classes = $classes | append $k }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .linkObject $effects.inlinecontent (eq .linkObject.MediaType.Type "image/svg+xml") }}
{{- $content := .linkObject.Content | replaceRE `(?s)^\s*<\?.*?\?>\s*` "" }}
{{- $attributes = merge $attributes (dict "content" $content) }}
{{- else if and .linkObject $effects.dataurl }}
{{- $src := printf "data:%s;base64,%s" .linkObject.MediaType.Type (.linkObject.Content | base64Encode) }}
{{- $attributes = merge $attributes (dict "src" $src) }}
{{- else }}
{{- $attributes = merge $attributes (dict "src" .url) }}
{{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "style" (printf " height: %s; width: %s;%s" $height $width (index $attributes "style" | default ""))) }}
{{- if $effects.lazy }}{{ $attributes = merge $attributes (dict "loading" "lazy") }}{{ end }}
{{- return $attributes }}

View file

@ -1,72 +1,72 @@
{{- $attributes := .attributes | default dict }}
{{- /* target will be boolean false if no user defined value was set and effect default should be applied */}}
{{- $target := false }}
{{- $u := urls.Parse .url }}
{{- if $u.IsAbs }}
{{- $attributes = merge $attributes (dict "rel" "external") }}
{{- $target = "_blank" }}
{{- if isset .page.Site.Params "externallinktarget" }}
{{- $target = .page.Site.Params.externalLinkTarget }}
{{- if in (slice "false" false 0) $target }}
{{- $target = "" }}
{{- end }}
{{- if in (slice "true" true 1) $target }}
{{- $target = "_blank" }}
{{- end }}
{{- end }}
{{- end }}
{{- $effects := dict "download" false "target" false }}
{{- if .page.Site.Params.linkeffects }}
{{- $effects = merge $effects .page.Site.Params.linkeffects }}
{{- end }}
{{- if .page.Params.linkeffects }}
{{- $effects = merge $effects .page.Params.linkeffects }}
{{- end }}
{{- $target := .target | default $target }}
{{- if ne (printf "%T" $target) "bool" }}
{{- $effects = merge $effects (dict "target" $target) }}
{{- end }}
{{- if $u.RawQuery }}
{{- if $u.Query.Has "classes" }}
{{- $classes := slice | append (split ($u.Query.Get "classes") ",") }}
{{- range $classes }}
{{- $k := . }}
{{- $v := true }}
{{- if strings.HasPrefix $k "no" }}
{{- $k := strings.TrimPrefix "no" $k }}
{{- $v := false }}
{{- end }}
{{- $effects = merge $effects (dict $k $v) }}
{{- end }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $paramValue := $u.Query.Get $k }}
{{- $newValue := true }}
{{- if eq $paramValue "" }}
{{- $newValue = true }}
{{- else if eq $paramValue "true" }}
{{- $newValue = true }}
{{- else if eq $paramValue "false" }}
{{- $newValue = false }}
{{- else }}
{{- $newValue = $paramValue }}
{{- end }}
{{- $effects = merge $effects (dict $k $newValue) }}
{{- end }}
{{- end }}
{{- end }}
{{- $classes := slice }}
{{- range $k, $v := $effects }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- $classes = $classes | append $k }}
{{- end }}
{{- end }}
{{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "href" .url) }}
{{- $attributes = merge $attributes (dict "download" $effects.download) }}
{{- $attributes = merge $attributes (dict "target" $effects.target) }}
{{- $attributes := .attributes | default dict }}
{{- /* target will be boolean false if no user defined value was set and effect default should be applied */}}
{{- $target := false }}
{{- $u := urls.Parse .url }}
{{- if $u.IsAbs }}
{{- $attributes = merge $attributes (dict "rel" "external") }}
{{- $target = "_blank" }}
{{- if isset .page.Site.Params "externallinktarget" }}
{{- $target = .page.Site.Params.externalLinkTarget }}
{{- if in (slice "false" false 0) $target }}
{{- $target = "" }}
{{- end }}
{{- if in (slice "true" true 1) $target }}
{{- $target = "_blank" }}
{{- end }}
{{- end }}
{{- end }}
{{- $effects := dict "download" false "target" false }}
{{- if .page.Site.Params.linkeffects }}
{{- $effects = merge $effects .page.Site.Params.linkeffects }}
{{- end }}
{{- if .page.Params.linkeffects }}
{{- $effects = merge $effects .page.Params.linkeffects }}
{{- end }}
{{- $target := .target | default $target }}
{{- if ne (printf "%T" $target) "bool" }}
{{- $effects = merge $effects (dict "target" $target) }}
{{- end }}
{{- if $u.RawQuery }}
{{- if $u.Query.Has "classes" }}
{{- $classes := slice | append (split ($u.Query.Get "classes") ",") }}
{{- range $classes }}
{{- $k := . }}
{{- $v := true }}
{{- if strings.HasPrefix $k "no" }}
{{- $k := strings.TrimPrefix "no" $k }}
{{- $v := false }}
{{- end }}
{{- $effects = merge $effects (dict $k $v) }}
{{- end }}
{{- end }}
{{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }}
{{- $paramValue := $u.Query.Get $k }}
{{- $newValue := true }}
{{- if eq $paramValue "" }}
{{- $newValue = true }}
{{- else if eq $paramValue "true" }}
{{- $newValue = true }}
{{- else if eq $paramValue "false" }}
{{- $newValue = false }}
{{- else }}
{{- $newValue = $paramValue }}
{{- end }}
{{- $effects = merge $effects (dict $k $newValue) }}
{{- end }}
{{- end }}
{{- end }}
{{- $classes := slice }}
{{- range $k, $v := $effects }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- $classes = $classes | append $k }}
{{- end }}
{{- end }}
{{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "href" .url) }}
{{- $attributes = merge $attributes (dict "download" $effects.download) }}
{{- $attributes = merge $attributes (dict "target" $effects.target) }}
{{- return $attributes }}

View file

@ -1 +1 @@
7.3.2+3ac0206314069cacb7c5585d7271248b8304f4db
7.3.2+f9d00be7b4ca85e6b5c3070b2e1cf3588beeee11