From cd1f2ad8fd607fa63aae491a67ddcb4f28a94434 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 21 Feb 2026 08:45:08 +0100 Subject: [PATCH] =?utf8?q?Beispiele=20f=C3=BCr=20Code-Highlight=20vergleic?= =?utf8?q?hbar=20gemacht=20(Seiten=20Typo=20vs.=20Code)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- exampleSite/content/projects/code.md | 19 ++++++++++++++++--- exampleSite/content/projects/typo.html | 13 +++++++++++-- exampleSite/hugo.yaml | 6 ++++++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/exampleSite/content/projects/code.md b/exampleSite/content/projects/code.md index 6fdfdf82..3e3b40d8 100644 --- a/exampleSite/content/projects/code.md +++ b/exampleSite/content/projects/code.md @@ -1,13 +1,14 @@ --- title: "Code-Blocks" --- -Bash: +## As a code-block... +### Bash ```bash declare a=1 echo "$a" exit ``` -Java: +### Java ```java public class MyClass { @@ -15,7 +16,7 @@ public class MyClass private String bar; } ``` -GO: +### GO ```go {hl_lines=[3,"6-8"]} package main @@ -27,3 +28,15 @@ func main() { } } ``` +### GO (der exakt selbe Code, wie auf der Typo-Testseite: +```go +package main + +import "fmt" + +func main() { + for i := 0; i < 3; i++ { + fmt.Println("Value of i:", i) + } +} +``` diff --git a/exampleSite/content/projects/typo.html b/exampleSite/content/projects/typo.html index e6543709..2bd6176d 100644 --- a/exampleSite/content/projects/typo.html +++ b/exampleSite/content/projects/typo.html @@ -105,7 +105,8 @@ lastmod: "2026-02-03T17:30:49.452Z"

Syntax Highlighting by Hugo

As a code-block...

- {{< highlight go "linenos=inline, hl_lines=3 6-8, style=monokai" >}} +

GO

+ {{< highlight go "linenos=inline, hl_lines=3 6-8, style=paraiso-dark" >}} package main import "fmt" @@ -116,6 +117,14 @@ lastmod: "2026-02-03T17:30:49.452Z" } } {{< /highlight >}} +

Java

+ {{< highlight java "linenos=inline, hl_lines=3, style=paraiso-dark" >}} + public class MyClass + { + private int foo; + private String bar; + } + {{< /highlight >}}

...and inline

-

This is some {{< highlight go "linenos=false, hl_inline=true, style=monokai" >}}fmt.Println("inline"){{< /highlight >}} code.

+

This is some {{< highlight go "linenos=false, hl_inline=true, style=paraiso-dark" >}}fmt.Println("inline"){{< /highlight >}} code.

diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 9a78a8d7..b9490083 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -15,3 +15,9 @@ params: email: kai@juplo.de name: Kai Moritz title: Hugo-Theme for juplo.de +markup: + highlight: + codeFences: true + guessSyntax: true + style: paraiso-dark + lineNos: true -- 2.39.5