initial commit

This commit is contained in:
2025-02-19 00:16:57 +01:00
parent 1d9cd91fcd
commit d89698593b
1293 changed files with 55933 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<style>
/* image effects */
#R-body svg.purple,
#R-body svg.purple :not([fill]),
#R-body svg.purple :not([fill='black']),
#R-body svg.purple :not([fill='#000000']) {
fill: var(--INTERNAL-PRIMARY-color) !important;
}
/* logo */
#R-logo {
font-size: 1.4rem;
margin-bottom: -.8125rem;
margin-top: -.8125rem;
max-width: 100%;
width: 14.125rem;
}
@media only all and (max-width: 59.999rem) {
#R-logo {
font-size: 1rem;
margin-bottom: -.25rem;
margin-top: -.25rem;
}
}
#R-logo svg {
display: inline-block;
opacity: .945;
vertical-align: middle;
width: 26% !important;
}
@media only all and (max-width: 59.999rem) {
#R-logo svg {
width: 24.5% !important;
}
}
#R-logo svg * {
opacity: .945;
}
#R-logo .logo-title{
display: inline-block;
overflow-wrap: break-word;
text-align: left;
text-wrap: wrap;
vertical-align: middle;
width: 4.5em;
}
</style>

View File

@@ -0,0 +1,5 @@
<!-- CSS styles are in layouts/partials/custom-header.html -->
<a id="R-logo" href="{{ partial "permalink.gotmpl" (dict "to" .Site.Home) }}">
{{ partial "shortcodes/image.html" (dict "page" . "url" "/images/logo.svg?border=false&inlinecontent&lightbox=false&shadow=false") }}
<div class="logo-title">{{ .Site.Params.linkTitle | default .Site.Title }}</div>
</a>

View File

@@ -0,0 +1,153 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $content := .content }}
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
{{- $writenotice := cond (ne .writenotice nil) .writenotice false }}
{{- $langtrg := "pir" }}
{{- $langsrc := cond (eq $page.Language.Lang $langtrg) (.langsrc | default "en") $page.Language.Lang }}
{{- $baseURL := urls.Parse site.BaseURL }}
{{- $baseURLpath := $baseURL.Path | default "/" }}
{{- $l := $page.RelPermalink }}
{{- $c := "" }}
{{- $srcPage := "" }}
{{- if ne $content nil }}
{{- $c = $content }}
{{- else if eq $pagefield "Content" }}
{{- $c = $page.Content }}
{{- else if eq $pagefield "TableOfContents" }}
{{- $c = $page.TableOfContents }}
{{- end }}
{{- range $page.AllTranslations }}
{{- if eq .Language.Lang $langsrc }}
{{- $l = .RelPermalink }}
{{- if ne $content nil }}
{{- $c = $content }}
{{- else if eq $pagefield "Content" }}
{{- $c = .Content }}
{{- $srcPage = . }}
{{- else if eq $pagefield "TableOfContents" }}
{{- $c = .TableOfContents }}
{{- end }}
{{- break }}
{{- end }}
{{- end }}
{{- if eq $page.Language.Lang $langtrg }}
{{- if $writenotice }}
{{- partial "shortcodes/notice.html" (dict
"page" $page
"content" "<p>Fello' pirrrates, grog made us dizzy! Be awarrre some stuff may look weird in this trrranslat'n. Like seeing Merrrmaids and stuff.</p>\n"
"icon" "skull-crossbones"
"style" "warning"
"title" "Arrr! Pirrrates"
) }}
{{- end }}
{{- $words := dict
"Hugo" "Cap'n Hugo"
"Info" "Ahoi"
"Note" "Avast"
"Tip" "Smarrrt Arrrse"
"Warning" "Arrr"
"good" "bloody"
"shortcodes" "shorrrtcodes"
"Shortcodes" "Shorrrtcodes"
"Mermaid" "Merrrmaid"
"Markdown" "Marrrkdown"
"Markup" "Marrrkup"
"markup" "marrrkup"
"for" "fer"
"Your" "Yer"
"your" "yer"
"You" "Ye"
"you" "ye"
"the" "th'"
"The" "Th'"
"is" "be"
"Is" "Be"
"are" "be"
"Are" "Be"
"Of" "O'"
"of" "o'"
"To" "T'"
"to" "t'"
"in" "'n"
"With" "Wit'"
"with" "wit'"
"Where" "Whar'"
"where" "whar'"
"After" "Aft"
"And" "An'"
"and" "an'"
"Load" "Board"
"load" "board"
"Loaded" "Boarded"
"loaded" "boarded"
"Content" "Rrrambling"
"content" "rrrambling"
"icon" "ay'con"
"Icon" "Ay'con"
"icons" "ay'cons"
"Icons" "Ay'cons"
"syntax" "rules"
"Syntax" "Rules"
"Site" "Ship"
"site" "ship"
"Page" "Plank"
"page" "plank"
"Pages" "Planks"
"pages" "planks"
"Relearn" "Relearrrn"
"Learn" "Learrrn"
-}}
{{- $specials := dict
"(\\w)ing([\\s\\n<.,;?!:])" "'n"
"(\\w)ings([\\s\\n<.,;?!:])" "'ns"
"(\\w)tion([\\s\\n<.,;?!:])" "t'n"
"(\\w)tions([\\s\\n<.,;?!:])" "t'ns"
"(\\w)(?:[aeiou])ble([\\s\\n<.,;?!:])" "'ble"
"(\\w)(?:[aeiou])mize([\\s\\n<.,;?!:])" "'mize"
"(\\w)(?:[aeiou])mizes([\\s\\n<.,;?!:])" "'mizes"
"(\\w)(?:[aeiou])nize([\\s\\n<.,;?!:])" "'nize"
"(\\w)(?:[aeiou])nizes([\\s\\n<.,;?!:])" "'nizes"
-}}
{{- $links := slice
"href"
-}}
{{- $fix := dict
"warn'n" "warning"
"sect'n" "section"
"n Cap'n" "n"
"Avast right o' John" "Note right of John"
-}}
{{- range $from, $to := $words }}
{{- $c = replaceRE (printf "([\\s\\n>])%s([\\s\\n<.,;?!:])" $from) (printf "${1}%s${2}" $to) $c }}
{{- end }}
{{- range $from, $to := $specials }}
{{- $c = replaceRE $from (printf "${1}%s${2}" $to) $c }}
{{- end }}
{{- range $attr := $links }}
{{- $c = replaceRE (printf "\\b(%s)(=\"%s[^\"]*?\")" $attr $baseURLpath) "${1} data-piratify${2}" $c }}
{{- $m := findRESubmatch (printf "%s data-piratify=\"(%s)([^\"]*?)\"" $attr $baseURLpath) $c }}
{{- range $m }}
{{- $r := printf "%s=\"%s\"" $attr (index . 2) }}
{{- $u := urls.Parse (index . 2) }}
{{- if and (not $u.IsAbs) $u.Path }}
{{- $r = printf "%s=\"%s%s/%s\"" $attr $baseURLpath $langtrg (index . 2) }}
{{- end }}
{{- $c = replace $c (index . 0) $r }}
{{- end }}
{{- end }}
{{- range $from, $to := $fix }}
{{- $c = replace $c $from $to }}
{{- end }}
{{- if $srcPage }}
{{- range $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" .name }}
{{- $page.Store.Set $has (or ($page.Store.Get $has) ($srcPage.Store.Get $has)) }}
{{- end }}
{{- end }}
{{- end }}
{{- $c | safeHTML }}

View File

@@ -0,0 +1,4 @@
{{- partial "shortcodes/piratify.html" (dict
"page" .
"pagefield" "TableOfContents"
) }}