mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
piratify: reduce reader warnings #496
This commit is contained in:
parent
7252f82bb6
commit
243bede83d
6 changed files with 10 additions and 9 deletions
|
@ -2,4 +2,4 @@
|
|||
archetype = "home"
|
||||
title = "Cap'n Hugo Relearrrn Theme"
|
||||
+++
|
||||
{{< piratify >}}
|
||||
{{< piratify true >}}
|
|
@ -2,4 +2,4 @@
|
|||
descrption = "Beaut'fl math and chemical formulae"
|
||||
title = "Math"
|
||||
+++
|
||||
{{< piratify >}}
|
||||
{{< piratify true >}}
|
|
@ -2,4 +2,4 @@
|
|||
descrption = "Generrrat'n o' diagrrram an' flowcharrrt frrrom text 'n a similar manner as Marrrkdown"
|
||||
title = "Merrrmaid"
|
||||
+++
|
||||
{{< piratify >}}
|
||||
{{< piratify true >}}
|
|
@ -2,4 +2,4 @@
|
|||
description: "Adds UI fer yer Swaggerrr / OpenAPI Specificat'ns"
|
||||
title: "Swaggerrr"
|
||||
---
|
||||
{{< piratify >}}
|
||||
{{< piratify true >}}
|
|
@ -1,7 +1,7 @@
|
|||
{{- $context := .context }}
|
||||
{{- $content := .content }}
|
||||
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
|
||||
{{- $writenotice := cond (ne $content nil) false (cond (eq $pagefield "Content") true false) }}
|
||||
{{- $writenotice := cond (ne .writenotice nil) .writenotice false }}
|
||||
{{- $langtrg := "pir" }}
|
||||
{{- $langsrc := cond (eq $context.Page.Lang $langtrg) (.langsrc | default "en") $context.Page.Lang }}
|
||||
{{- $baseURL := urls.Parse site.BaseURL }}
|
||||
|
@ -25,7 +25,7 @@
|
|||
{{- if $writenotice }}
|
||||
{{- partial "shortcodes/notice.html" (dict
|
||||
"context" .
|
||||
"content" "<p>Fello' pirrrates, wrrrit'n are not fer us as yer can see! Also be awarrre <b>some stuff may not work</b> in this trrranslat'n. Like see'n <b>Merrrmaids</b>, do'n <b>math or chemistrrry</b> and stuff.</p>\n"
|
||||
"content" "<p>Fello' pirrrates, grog made us dizzy! Be awarrre <b>some stuff may not work</b> in this trrranslat'n. Like see'n <b>Merrrmaids</b>, do'n <b>math or chemistrrry</b>, writ'n docs and stuff.</p>\n"
|
||||
"icon" "skull-crossbones"
|
||||
"style" "warning"
|
||||
"title" "Arrr! Pirrrates"
|
||||
|
@ -119,6 +119,6 @@
|
|||
{{- if (int (len $l)) }}
|
||||
{{- $c = replaceRE "(src|href)=\"(images/[^\"]*?\")" (printf "${1}=\"%s${2}" $l) $c }}
|
||||
{{- end }}
|
||||
{{- $c = replaceRE "(src|href)=\"([^\"]*?)/pir/([^\"]*?.files/[^\"]*?\")" "${1}=\"${2}/${3}" $c }}
|
||||
{{- $c = replaceRE (printf "(src|href)=\"([^\"]*?)/%s/([^\"]*?.files/[^\"]*?\")" $langtrg) "${1}=\"${2}/${3}" $c }}
|
||||
{{- end }}
|
||||
{{ $c | safeHTML }}
|
|
@ -1,4 +1,5 @@
|
|||
{{- partial "shortcodes/piratify.html" (dict
|
||||
"context" .
|
||||
"pagefield" "Content"
|
||||
"context" .
|
||||
"pagefield" "Content"
|
||||
"writenotice" (.Get "writenotice" | default (.Get 0))
|
||||
) }}
|
Loading…
Reference in a new issue