diff --git a/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg b/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg new file mode 100644 index 0000000..8be86aa --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/demo-diagram.md b/exampleSiteMultilingual/content/posts/demo-diagram/index.md similarity index 100% rename from exampleSiteMultilingual/content/posts/demo-diagram.md rename to exampleSiteMultilingual/content/posts/demo-diagram/index.md diff --git a/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md b/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md new file mode 100644 index 0000000..7a09429 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md @@ -0,0 +1,110 @@ ++++ +author = "Hugo Authors" +title = "Demo - Support for Diagrams" +date = "2024-05-06" +description = "Guide to advanced usage of Anubis2" +tags = [ + "emoji", +] ++++ + +Feel free to switch between the light and dark themes to see how the diagram adapts its colors accordingly. + +## Mermaid Diagrams + +```mermaid +gantt + title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1, 20d + section Another + Task in Another :2014-01-12, 12d + another task :24d + +``` + +Get more examples at [About Mermaid](https://mermaid.js.org/intro/) + + + +```mermaid +gitGraph: + commit "Ashish" + branch newbranch + checkout newbranch + commit id:"1111" + commit tag:"test" + checkout main + commit type: HIGHLIGHT + commit + merge newbranch + commit + branch b2 + commit +``` + + + +```mermaid +stateDiagram + [*] --> Still + Still --> [*] + + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] + +``` + +```mermaid +sankey-beta + +Pumped heat,"Heating and cooling, ""homes""",193.026 +Pumped heat,"Heating and cooling, ""commercial""",70.672 +``` + +```mermaid +sequenceDiagram + loop Daily query + Alice->>Bob: Hello Bob, how are you? + alt is sick + Bob->>Alice: Not so good :( + else is well + Bob->>Alice: Feeling fresh like a daisy + end + + opt Extra response + Bob->>Alice: Thanks for asking + end + end + +``` + +```mermaid +sequenceDiagram + participant Alice + participant Bob + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts
prevail! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +``` + +## GoAT + +```goat + . . . .--- 1 .-- 1 / 1 + / \ | | .---+ .-+ + + / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2 + + + | | | | ---+ ---+ + + / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3 + / \ / \ | | | | | | | | '---+ '-+ + + 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 +``` diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index f4be162..8a0757e 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -3,11 +3,13 @@ languageCode = "en-us" defaultContentLanguage = "en" title = "Anubis2 Demo Site" theme = "anubis2" -paginate = 5 - disqusShortname = "" -[author] +[pagination] +pagerSize = 5 + + +[params.author] name = "Junyi" email = "me@junyi.dev" location = "Singapore" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 15a4ed7..7dccba1 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -12,9 +12,27 @@ {{ .RelPermalink }} {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}} + {{ with .Site.Params.author }} + {{ with .email }} + {{.}} + {{ with $.Site.Params.author.name }} + ({{.}}) + {{end}} + + {{end}} + + {{ with .Site.Params.author.email }} + + {{.}} + {{ with $.Site.Params.author.name }} + ({{.}}) + {{end}} + + {{end}} + {{ end }} + + {{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} @@ -25,7 +43,7 @@ {{ .Title }} {{ .RelPermalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.author.email }}{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}{{end}} {{ .RelPermalink }} {{ .Content | html }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c9a53af..296faa9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,8 +23,8 @@ {{ $readNextPosts := 3}} - {{ if isset .Site.Params "readnextposts" }} - {{ $readNextPosts = .Site.Params.readNextPosts }} + {{ if site.Params.readNextPosts }} + {{ $readNextPosts = site.Params.readNextPosts }} {{ end }} {{ if gt $readNextPosts 0 }} @@ -56,7 +56,7 @@ {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} {{ $colorTheme := "light" }} - {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index aae2a24..3e3a652 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if .Site.DisqusShortname }} +{{ if .Site.Config.Services.Disqus.Shortname }} {{ partial "disqus.html" . }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ea511b7..1a0917d 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,23 +5,23 @@ {{ end }}