diff --git a/exampleSiteMultilingual/content/posts/emoji-support.md b/exampleSiteMultilingual/content/posts/emoji-support.md index 119346a..e16eeeb 100644 --- a/exampleSiteMultilingual/content/posts/emoji-support.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.md @@ -9,7 +9,7 @@ tags = [ +++ Emoji can be enabled in a Hugo project in a number of ways. - + The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. diff --git a/exampleSiteMultilingual/content/posts/emoji-support.zh.md b/exampleSiteMultilingual/content/posts/emoji-support.zh.md index 5c11cf4..3d449e1 100644 --- a/exampleSiteMultilingual/content/posts/emoji-support.zh.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.zh.md @@ -10,8 +10,6 @@ tags = [ 在 Hugo 博客里,你可以用多种方式使用 Emoji: - - The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. diff --git a/exampleSiteMultilingual/content/posts/markdown-syntax.md b/exampleSiteMultilingual/content/posts/markdown-syntax.md index a092b24..77121be 100644 --- a/exampleSiteMultilingual/content/posts/markdown-syntax.md +++ b/exampleSiteMultilingual/content/posts/markdown-syntax.md @@ -18,7 +18,10 @@ aliases = ["migrate-from-jekyl"] favorite = true +++ -This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. +[This article](https://www.baidu.com/) offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + +https://www.baidu.com + diff --git a/exampleSiteMultilingual/content/posts/math-typesetting.md b/exampleSiteMultilingual/content/posts/math-typesetting.md index 9d96925..29dbd1c 100644 --- a/exampleSiteMultilingual/content/posts/math-typesetting.md +++ b/exampleSiteMultilingual/content/posts/math-typesetting.md @@ -2,38 +2,15 @@ author: Hugo Authors title: Math Typesetting date: 2019-03-08 -description: A brief guide to setup KaTeX +description: A brief guide to setup MathJax math: true --- Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. - -In this example we will be using [KaTeX](https://katex.org/) +- To enable MathJax on a page basis include the parameter `math: true` in content files. -- Create a partial under `/layouts/partials/math.html` -- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. -- Include the partial in your templates like so: - -``` -{{ if or .Params.math .Site.Params.math }} -{{ partial "math.html" . }} -{{ end }} -``` -- To enable KaTex globally set the parameter `math` to `true` in a project's configuration -- To enable KaTex on a per page basis include the parameter `math: true` in content files. - -**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) -{{< math.inline >}} -{{ if or .Page.Params.math .Site.Params.math }} - - - - -{{ end }} -{{}} - -### Examples +## Examples Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ diff --git a/exampleSiteMultilingual/content/posts/placeholder-text.md b/exampleSiteMultilingual/content/posts/placeholder-text.md index 1e9ee4e..ac70ed6 100644 --- a/exampleSiteMultilingual/content/posts/placeholder-text.md +++ b/exampleSiteMultilingual/content/posts/placeholder-text.md @@ -31,7 +31,7 @@ tractus malis. 4. Arcanaque montibus omnes 5. Quidem et -# Vagus elidunt +## Vagus elidunt diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 296faa9..c16b949 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -53,29 +53,10 @@ */}} {{ if .Store.Get "hasMermaid" }} - {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} + {{ partial "mermaid_support.html" . }} + {{ end }} - {{ $colorTheme := "light" }} - {{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }} - {{ $colorTheme = site.Params.colortheme | lower }} - {{ end }} - - + {{ if .Params.math }} + {{ partial "mathjax_support.html" . }} {{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index f134cf2..9330ffd 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -8,6 +8,7 @@ {{ range (.Paginate $pages).Pages }} {{ partial "post-summary.html" . }} {{ end }} + {{ partial "pagination.html" . }} diff --git a/layouts/partials/mermaid_support.html b/layouts/partials/mermaid_support.html new file mode 100644 index 0000000..f3f298f --- /dev/null +++ b/layouts/partials/mermaid_support.html @@ -0,0 +1,24 @@ +{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} + +{{ $colorTheme := "light" }} +{{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }} +{{ $colorTheme = site.Params.colortheme | lower }} +{{ end }} + + diff --git a/layouts/partials/post-summary.html b/layouts/partials/post-summary.html index fd8fa8c..a9babeb 100644 --- a/layouts/partials/post-summary.html +++ b/layouts/partials/post-summary.html @@ -34,6 +34,14 @@ {{ i18n "readMore" }} {{ end }} + + {{ if .Store.Get "hasMermaid" }} + {{ partial "mermaid_support.html" . }} + {{ end }} + + {{ if .Params.math }} + {{ partial "mathjax_support.html" . }} + {{ end }} {{ partial "post-info.html" . }}