From ac2950a4c01b1483febcff06361498a26b77118c Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 11 Sep 2024 12:06:53 +0800 Subject: [PATCH] fix: icon now shown in other languages. --- .../content/posts/demo-diagram/icon.svg | 1 + .../index.md} | 0 .../content/posts/demo-diagram/index.zh.md | 110 ++++++++++++++++++ layouts/partials/post-summary.html | 4 +- 4 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 exampleSiteMultilingual/content/posts/demo-diagram/icon.svg rename exampleSiteMultilingual/content/posts/{demo-diagram.md => demo-diagram/index.md} (100%) create mode 100644 exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md 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/layouts/partials/post-summary.html b/layouts/partials/post-summary.html index 732f7b1..fd8fa8c 100644 --- a/layouts/partials/post-summary.html +++ b/layouts/partials/post-summary.html @@ -2,13 +2,13 @@
{{ $random := (md5 .Title) }} - {{ $iconPath := printf "%s/icon.svg" .File.Dir }} + {{ $iconPath := printf "%sicon.svg" .File.Dir }} {{ if fileExists $iconPath }}