mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
piratify: support for shortcodes math, mermaid and openapi #596
This commit is contained in:
parent
9b47e855b8
commit
09ffd597a1
2 changed files with 8 additions and 3 deletions
|
@ -2,4 +2,4 @@
|
||||||
description: "Adds UI fer yer OpenAPI / Swaggerrr Specificat'ns"
|
description: "Adds UI fer yer OpenAPI / Swaggerrr Specificat'ns"
|
||||||
title: "OpenAPI"
|
title: "OpenAPI"
|
||||||
---
|
---
|
||||||
{{< piratify true >}}
|
{{< piratify >}}
|
|
@ -22,6 +22,7 @@
|
||||||
{{- $c = $content }}
|
{{- $c = $content }}
|
||||||
{{- else if eq $pagefield "Content" }}
|
{{- else if eq $pagefield "Content" }}
|
||||||
{{- $c = .Content }}
|
{{- $c = .Content }}
|
||||||
|
{{- $srcPage = . }}
|
||||||
{{- else if eq $pagefield "TableOfContents" }}
|
{{- else if eq $pagefield "TableOfContents" }}
|
||||||
{{- $c = .TableOfContents }}
|
{{- $c = .TableOfContents }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
{{- if $writenotice }}
|
{{- if $writenotice }}
|
||||||
{{- partial "shortcodes/notice.html" (dict
|
{{- partial "shortcodes/notice.html" (dict
|
||||||
"context" $context
|
"context" $context
|
||||||
"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"
|
"content" "<p>Fello' pirrrates, grog made us dizzy! Be awarrre <b>some stuff may look weird</b> in this trrranslat'n. Like <b>Merrrmaids</b>, do'n <b>math or chemistrrry</b> and stuff.</p>\n"
|
||||||
"icon" "skull-crossbones"
|
"icon" "skull-crossbones"
|
||||||
"style" "warning"
|
"style" "warning"
|
||||||
"title" "Arrr! Pirrrates"
|
"title" "Arrr! Pirrrates"
|
||||||
|
@ -72,7 +73,6 @@
|
||||||
"Where" "Whar'"
|
"Where" "Whar'"
|
||||||
"where" "whar'"
|
"where" "whar'"
|
||||||
"After" "Aft"
|
"After" "Aft"
|
||||||
"after" "aft"
|
|
||||||
"And" "An'"
|
"And" "An'"
|
||||||
"and" "an'"
|
"and" "an'"
|
||||||
"Load" "Board"
|
"Load" "Board"
|
||||||
|
@ -127,5 +127,10 @@
|
||||||
{{- $c = replaceRE "(src|href)=\"(images/[^\"]*?\")" (printf "${1}=\"%s${2}" $l) $c }}
|
{{- $c = replaceRE "(src|href)=\"(images/[^\"]*?\")" (printf "${1}=\"%s${2}" $l) $c }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $c = replaceRE (printf "(src|href)=\"([^\"]*?)/%s/([^\"]*?.files/[^\"]*?\")" $langtrg) "${1}=\"${2}/${3}" $c }}
|
{{- $c = replaceRE (printf "(src|href)=\"([^\"]*?)/%s/([^\"]*?.files/[^\"]*?\")" $langtrg) "${1}=\"${2}/${3}" $c }}
|
||||||
|
{{- if $srcPage }}
|
||||||
|
{{- $context.Store.Set "hasMathJax" (or ($context.Store.Get "hasMathJax") ($srcPage.Store.Get "hasMathJax")) }}
|
||||||
|
{{- $context.Store.Set "hasMermaid" (or ($context.Store.Get "hasMermaid") ($srcPage.Store.Get "hasMermaid")) }}
|
||||||
|
{{- $context.Store.Set "hasOpenapi" (or ($context.Store.Get "hasOpenapi") ($srcPage.Store.Get "hasOpenapi")) }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ $c | safeHTML }}
|
{{ $c | safeHTML }}
|
Loading…
Reference in a new issue