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 # https://editorconfig.org
root = true root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_size = 2 end_of_line = lf
indent_style = space indent_size = 2
insert_final_newline = true indent_style = space
max_line_length = 9999 insert_final_newline = true
trim_trailing_whitespace = true max_line_length = 9999
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false [*.md]
trim_trailing_whitespace = false

16
.gitignore vendored
View file

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

View file

@ -1,22 +1,22 @@
assets/css/chroma*.css assets/css/chroma*.css
assets/css/variables.css assets/css/variables.css
assets/_relearn_searchindex.js assets/_relearn_searchindex.js
docs/.frontmatter docs/.frontmatter
docs/content docs/content
docs/layouts docs/layouts
docs/static docs/static
docs/frontmatter.json docs/frontmatter.json
exampleSite exampleSite
layouts layouts
static/css/auto-complete.css static/css/auto-complete.css
static/css/*.min.css static/css/*.min.css
static/css/swagger*.css static/css/swagger*.css
static/js/d3 static/js/d3
static/js/lunr static/js/lunr
static/js/mathjax static/js/mathjax
static/js/swagger-ui static/js/swagger-ui
static/js/auto-complete.js static/js/auto-complete.js
static/js/*.min.js static/js/*.min.js
*.md *.md
*.yaml *.yaml
*.yml *.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", "editor.defaultFormatter": "esbenp.prettier-vscode",
"[css]": { "[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[json]": { "[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[yaml]": { "[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"editor.formatOnSave": true, "editor.formatOnSave": true,
"extensions.ignoreRecommendations": false, "extensions.ignoreRecommendations": false,
"prettier.useEditorConfig": true, "prettier.useEditorConfig": true,
"spellright.documentTypes": ["latex", "markdown"], "spellright.documentTypes": ["latex", "markdown"],
"spellright.language": ["en"] "spellright.language": ["en"]
} }

View file

@ -1,29 +1,29 @@
+++ +++
description = 'Launch Day' description = 'Launch Day'
title = 'Day 1' title = 'Day 1'
weight = 1 weight = 1
+++ +++
## Launch Day ## Launch Day
**Captains Log, 0120 hours** **Captains Log, 0120 hours**
> ***"No mission too saucy for us!"*** > ***"No mission too saucy for us!"***
> Captains official decree > 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. 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 ### Status
- **Reason for voyage:** A midnight run to deliver top-secret cargo (pasta flour and extra marinara). - **Reason for voyage:** A midnight run to deliver top-secret cargo (pasta flour and extra marinara).
- **Crew status:** - **Crew status:**
- Eager to set sail - Eager to set sail
- Full of energy (and possibly leftover breadsticks) - Full of energy (and possibly leftover breadsticks)
### Early Observations ### 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. 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. 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' description = 'At Sea'
title = 'Day 2' title = 'Day 2'
weight = 2 weight = 2
+++ +++
## At Sea ## At Sea
**Captains Log, 0545 hours** **Captains Log, 0545 hours**
> ***"A little sea spray cant break our spirit—nor our appetite!"*** > ***"A little sea spray cant break our spirit—nor our appetite!"***
> The Chef, after a minor sauce-spill incident > 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." 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 ### Status
- **Weather:** Slightly stormy with a touch of dramatic sea mist - **Weather:** Slightly stormy with a touch of dramatic sea mist
- **Crew Morale:** - **Crew Morale:**
1. Excitement level: High 1. Excitement level: High
2. Hunger level: *Astronomical* 2. Hunger level: *Astronomical*
3. Willingness to sing shanties: ∞ 3. Willingness to sing shanties: ∞
### Culinary Update ### Culinary Update
The kitchen rattles with every wave, saucepans clanging like a symphony of disorganized percussion. Marinara overboard? Twice. 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**. 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! 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' description = 'Island Arrival'
title = 'Day 3' title = 'Day 3'
weight = 3 weight = 3
+++ +++
## Island Arrival ## Island Arrival
**Captains Log, 1140 hours** **Captains Log, 1140 hours**
> ***"Ahoy, pasta-lovers! Our mission is finally a sauce-cess!"*** > ***"Ahoy, pasta-lovers! Our mission is finally a sauce-cess!"***
> The Enthused Quartermaster > 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. The sun blazes overhead, revealing an island coastline shaped like a **questionable noodle bowl** — the perfect destination for our midnight pasta cargo.
### Status ### Status
- Purple sails flutter in the island breeze - 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 - 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 - *Slight tang* of marinara lingers across the entire deck
### Incident in the Crow's Nest ### 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. 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. 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 > [!primary]+ Mission Debriefing
> - [x] Crates of sauce offloaded with care (and the occasional accidental slosh) > - [x] Crates of sauce offloaded with care (and the occasional accidental slosh)
> - [x] Crowds of locals, excited for fresh spaghetti > - [x] Crowds of locals, excited for fresh spaghetti
> - [ ] _Squid ink_ banner hoisted high to announce “Operation Squid Spaghetti Complete” > - [ ] _Squid ink_ banner hoisted high to announce “Operation Squid Spaghetti Complete”

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,79 +1,79 @@
{{- $attributes := .attributes | default dict }} {{- $attributes := .attributes | default dict }}
{{- $height := "auto" }} {{- $height := "auto" }}
{{- $width := "auto" }} {{- $width := "auto" }}
{{- $effects := dict "border" false "dataurl" false "inlinecontent" false "lazy" true "lightbox" true "shadow" false }} {{- $effects := dict "border" false "dataurl" false "inlinecontent" false "lazy" true "lightbox" true "shadow" false }}
{{- if .page.Site.Params.imageeffects }} {{- if .page.Site.Params.imageeffects }}
{{- $effects = merge $effects .page.Site.Params.imageeffects }} {{- $effects = merge $effects .page.Site.Params.imageeffects }}
{{- end }} {{- end }}
{{- if .page.Params.imageEffects }} {{- if .page.Params.imageEffects }}
{{- $effects = merge $effects .page.Params.imageEffects }} {{- $effects = merge $effects .page.Params.imageEffects }}
{{- end }} {{- end }}
{{- $u := urls.Parse .url }} {{- $u := urls.Parse .url }}
{{- if $u.RawQuery }} {{- if $u.RawQuery }}
{{- if $u.Query.Has "classes" }} {{- if $u.Query.Has "classes" }}
{{- $classes := slice | append (split ($u.Query.Get "classes") ",") }} {{- $classes := slice | append (split ($u.Query.Get "classes") ",") }}
{{- range $classes }} {{- range $classes }}
{{- $k := . }} {{- $k := . }}
{{- $v := true }} {{- $v := true }}
{{- if strings.HasPrefix $k "no" }} {{- if strings.HasPrefix $k "no" }}
{{- $k := strings.TrimPrefix "no" $k }} {{- $k := strings.TrimPrefix "no" $k }}
{{- $v := false }} {{- $v := false }}
{{- end }} {{- end }}
{{- $effects = merge $effects (dict $k $v) }} {{- $effects = merge $effects (dict $k $v) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $u.Query.Has "featherlight" }} {{- if $u.Query.Has "featherlight" }}
{{- $filepath := "[virtual file]" }}{{ with and .page .page.File .page.File.Filename }}{{ $filepath = . }}{{ end }} {{- $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 }} {{- 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")) }} {{- $effects = merge $effects (dict "lightbox" (ne ($u.Query.Get "featherlight") "false")) }}
{{- end }} {{- end }}
{{- range $k, $v := $effects }} {{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }} {{- if $u.Query.Has $k }}
{{- $effects = merge $effects (dict $k (ne ($u.Query.Get $k) "false")) }} {{- $effects = merge $effects (dict $k (ne ($u.Query.Get $k) "false")) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- range $k, $v := $effects }} {{- range $k, $v := $effects }}
{{- if $u.Query.Has $k }} {{- if $u.Query.Has $k }}
{{- $paramValue := $u.Query.Get $k }} {{- $paramValue := $u.Query.Get $k }}
{{- $newValue := true }} {{- $newValue := true }}
{{- if eq $paramValue "" }} {{- if eq $paramValue "" }}
{{- $newValue = true }} {{- $newValue = true }}
{{- else if eq $paramValue "true" }} {{- else if eq $paramValue "true" }}
{{- $newValue = true }} {{- $newValue = true }}
{{- else if eq $paramValue "false" }} {{- else if eq $paramValue "false" }}
{{- $newValue = false }} {{- $newValue = false }}
{{- else }} {{- else }}
{{- $newValue = $paramValue }} {{- $newValue = $paramValue }}
{{- end }} {{- end }}
{{- $effects = merge $effects (dict $k $newValue) }} {{- $effects = merge $effects (dict $k $newValue) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with $u.Query.Get "height" }} {{- with $u.Query.Get "height" }}
{{- $height = . }} {{- $height = . }}
{{- end }} {{- end }}
{{- with $u.Query.Get "width" }} {{- with $u.Query.Get "width" }}
{{- $width = . }} {{- $width = . }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- $classes := slice }} {{- $classes := slice }}
{{- range $k, $v := $effects }} {{- range $k, $v := $effects }}
{{- if $v }} {{- if $v }}
{{- if eq (printf "%T" $v) "bool" }} {{- if eq (printf "%T" $v) "bool" }}
{{- $classes = $classes | append $k }} {{- $classes = $classes | append $k }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if and .linkObject $effects.inlinecontent (eq .linkObject.MediaType.Type "image/svg+xml") }} {{- if and .linkObject $effects.inlinecontent (eq .linkObject.MediaType.Type "image/svg+xml") }}
{{- $content := .linkObject.Content | replaceRE `(?s)^\s*<\?.*?\?>\s*` "" }} {{- $content := .linkObject.Content | replaceRE `(?s)^\s*<\?.*?\?>\s*` "" }}
{{- $attributes = merge $attributes (dict "content" $content) }} {{- $attributes = merge $attributes (dict "content" $content) }}
{{- else if and .linkObject $effects.dataurl }} {{- else if and .linkObject $effects.dataurl }}
{{- $src := printf "data:%s;base64,%s" .linkObject.MediaType.Type (.linkObject.Content | base64Encode) }} {{- $src := printf "data:%s;base64,%s" .linkObject.MediaType.Type (.linkObject.Content | base64Encode) }}
{{- $attributes = merge $attributes (dict "src" $src) }} {{- $attributes = merge $attributes (dict "src" $src) }}
{{- else }} {{- else }}
{{- $attributes = merge $attributes (dict "src" .url) }} {{- $attributes = merge $attributes (dict "src" .url) }}
{{- end }} {{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }} {{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }} {{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "style" (printf " height: %s; width: %s;%s" $height $width (index $attributes "style" | default ""))) }} {{- $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 }} {{- if $effects.lazy }}{{ $attributes = merge $attributes (dict "loading" "lazy") }}{{ end }}
{{- return $attributes }} {{- return $attributes }}

View file

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

View file

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