From: Kai Moritz Date: Sat, 21 Feb 2026 07:45:08 +0000 (+0100) Subject: Beispiele für Code-Highlight vergleichbar gemacht (Seiten Typo vs. Code) X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=cd1f2ad8fd607fa63aae491a67ddcb4f28a94434;p=website Beispiele für Code-Highlight vergleichbar gemacht (Seiten Typo vs. Code) --- 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