switch back to LoveIt, other theme is deprectated
This commit is contained in:
parent
260b6803e7
commit
51fb029ca2
4260 changed files with 49552 additions and 87082 deletions
9
themes/LoveIt/layouts/partials/function/checkbox.html
Normal file
9
themes/LoveIt/layouts/partials/function/checkbox.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{- /* Checkbox unchecked */ -}}
|
||||
{{- $old := `<input disabled="" type="checkbox">` -}}
|
||||
{{- $new := `<i class="far fa-square fa-fw" aria-hidden="true"></i>` -}}
|
||||
{{- $content := replace . $old $new -}}
|
||||
|
||||
{{- /* Checkbox checked */ -}}
|
||||
{{- $old = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $new = `<i class="far fa-check-square fa-fw" aria-hidden="true"></i>` -}}
|
||||
{{- return replace $content $old $new -}}
|
23
themes/LoveIt/layouts/partials/function/content.html
Normal file
23
themes/LoveIt/layouts/partials/function/content.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{- $content := .Content -}}
|
||||
|
||||
{{- if $content -}}
|
||||
|
||||
{{- if .Ruby -}}
|
||||
{{- $content = partial "function/ruby.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Fraction -}}
|
||||
{{- $content = partial "function/fraction.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Fontawesome -}}
|
||||
{{- $content = partial "function/fontawesome.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $content = partial "function/checkbox.html" $content -}}
|
||||
|
||||
{{- $content = partial "function/escape.html" $content -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- return $content -}}
|
5
themes/LoveIt/layouts/partials/function/escape.html
Normal file
5
themes/LoveIt/layouts/partials/function/escape.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{- /* Escape character */ -}}
|
||||
{{- /* {?X} -> X */ -}}
|
||||
{{- $REin := `\{\?(.)\}` -}}
|
||||
{{- $REout := `$1` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
14
themes/LoveIt/layouts/partials/function/fontawesome.html
Normal file
14
themes/LoveIt/layouts/partials/function/fontawesome.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{- /* Font Awesome */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw" aria-hidden="true"></i> */ -}}
|
||||
|
||||
{{- $REin := ` (:\([\w- ]+?\):)` -}}
|
||||
{{- $REout := ` $1` -}}
|
||||
{{- $content := replaceRE $REin $REout . -}}
|
||||
|
||||
{{- $REin = `(:\([\w- ]+?\):) ` -}}
|
||||
{{- $REout = `$1 ` -}}
|
||||
{{- $content = replaceRE $REin $REout . -}}
|
||||
|
||||
{{- $REin = `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout = `<i class="$1" aria-hidden="true"></i>` -}}
|
||||
{{- return replaceRE $REin $REout $content -}}
|
5
themes/LoveIt/layouts/partials/function/fraction.html
Normal file
5
themes/LoveIt/layouts/partials/function/fraction.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{- /* Fraction */ -}}
|
||||
{{- /* [A]/[B] -> <sup>A</sup>/<sub>B</sub> */ -}}
|
||||
{{- $REin := `\[(.+?)\]/\[(.+?)\]` -}}
|
||||
{{- $REout := `<sup>$1</sup>/<sub>$2</sub>` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
8
themes/LoveIt/layouts/partials/function/id.html
Normal file
8
themes/LoveIt/layouts/partials/function/id.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{- /* ID */ -}}
|
||||
{{- $count := (.Scratch.Get "this").count | default 1 -}}
|
||||
{{- $id := printf "id-%d" $count -}}
|
||||
{{- $count | add 1 | .Scratch.SetInMap "this" "count" -}}
|
||||
{{- with .Content -}}
|
||||
{{- dict $id . | dict "data" | dict "config" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
||||
{{- end -}}
|
||||
{{- return $id -}}
|
3
themes/LoveIt/layouts/partials/function/path.html
Normal file
3
themes/LoveIt/layouts/partials/function/path.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{- /* https://discourse.gohugo.io/t/how-decode-urls-in-hugo/7549/4 */ -}}
|
||||
{{- $URL := . | urlize | urls.Parse -}}
|
||||
{{- return $URL.Path -}}
|
16
themes/LoveIt/layouts/partials/function/resource.html
Normal file
16
themes/LoveIt/layouts/partials/function/resource.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{- $resource := 0 -}}
|
||||
{{- $url := urls.Parse .Path -}}
|
||||
{{- if not $url.Host | and $url.Path | and (strings.HasSuffix $url.Path "/" | not) -}}
|
||||
{{- if .Resources -}}
|
||||
{{- with .Resources.GetMatch $url.Path -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $resource -}}
|
||||
{{- with resources.Get $url.Path -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $resource -}}
|
5
themes/LoveIt/layouts/partials/function/ruby.html
Normal file
5
themes/LoveIt/layouts/partials/function/ruby.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{- /* Ruby */ -}}
|
||||
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
|
||||
{{- $REin := `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout := `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
Loading…
Add table
Add a link
Reference in a new issue