diff options
author | Dillon <dillonzq@outlook.com> | 2020-03-17 19:52:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-17 19:52:36 +0300 |
commit | 84d48f37dcf35e9f414445e1eed3489c674fe1af (patch) | |
tree | 352de3c33b32ad1a90e55b7766cedd964658e0e5 /layouts | |
parent | 01d814ef6fa585e82991bcb9e24c27c908ee82f0 (diff) |
feat(syntax): add fraction syntax (#181)
* feat(syntax): add fraction syntax
* docs: add remind for Hugo extended version
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/assets.html | 1 | ||||
-rw-r--r-- | layouts/partials/function/fraction.html | 5 | ||||
-rw-r--r-- | layouts/partials/single/content.html | 6 | ||||
-rw-r--r-- | layouts/taxonomy/terms.html | 2 |
4 files changed, 11 insertions, 3 deletions
diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 4beb7f2..70b2fae 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -70,6 +70,7 @@ exThumbImage: 'data-thumbnail', thumbWidth: 80, thumbContHeight: 80, + actualSize: false, }); }); </script> diff --git a/layouts/partials/function/fraction.html b/layouts/partials/function/fraction.html new file mode 100644 index 0000000..9aa85d0 --- /dev/null +++ b/layouts/partials/function/fraction.html @@ -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 . -}} diff --git a/layouts/partials/single/content.html b/layouts/partials/single/content.html index efab566..1337316 100644 --- a/layouts/partials/single/content.html +++ b/layouts/partials/single/content.html @@ -1,9 +1,11 @@ {{- $content := . -}} -{{- $content = partial "function/fontawesome.html" $content -}} - {{- $content = partial "function/ruby.html" $content -}} +{{- $content = partial "function/fraction.html" $content -}} + +{{- $content = partial "function/fontawesome.html" $content -}} + {{- $content = partial "function/checkbox.html" $content -}} {{- $content = partial "function/escape.html" $content -}} diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html index 83f7b63..28062a5 100644 --- a/layouts/taxonomy/terms.html +++ b/layouts/taxonomy/terms.html @@ -49,7 +49,7 @@ {{- else if eq $taxonomies "tags" -}} <div class="tag-cloud-tags"> {{- range $.Site.Taxonomies.tags.ByCount -}} - <a href="{{ .Page.RelPermalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a> + <a href="{{ .Page.RelPermalink }}"> {{ .Page.Title }} <sup>{{ .Count }}</sup></a> {{- end -}} </div> {{- end -}} |