]> juplo.de Git - website/commitdiff
Beispiele für Code-Highlight vergleichbar gemacht (Seiten Typo vs. Code)
authorKai Moritz <kai@juplo.de>
Sat, 21 Feb 2026 07:45:08 +0000 (08:45 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 7 Apr 2026 16:40:53 +0000 (18:40 +0200)
exampleSite/content/projects/code.md
exampleSite/content/projects/typo.html
exampleSite/hugo.yaml

index 6fdfdf8274dc74273043f08f7d2ba2890de5f705..3e3b40d88aebd1e1c436e654a8c884749bbb47ad 100644 (file)
@@ -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)
+    }
+}
+```
index e65437096d5c4dd46ae72d75d7ed8927e415ed51..2bd6176d98aef2e89f83265946daf61680bd63d7 100644 (file)
@@ -105,7 +105,8 @@ lastmod: "2026-02-03T17:30:49.452Z"
 </code></pre>
       <h1>Syntax Highlighting by Hugo</h1>
       <h2>As a code-block...</h2>
-      {{< highlight go "linenos=inline, hl_lines=3 6-8, style=monokai" >}}
+      <h3>GO</h3>
+      {{< 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 >}}
+      <h3>Java</h3>
+      {{< highlight java "linenos=inline, hl_lines=3, style=paraiso-dark" >}}
+      public class MyClass
+      {
+        private int foo;
+        private String bar;
+      }
+      {{< /highlight >}}
       <h2>...and inline</h2>
-      <p>This is some {{< highlight go "linenos=false, hl_inline=true, style=monokai" >}}fmt.Println("inline"){{< /highlight >}} code.</p>
+      <p>This is some {{< highlight go "linenos=false, hl_inline=true, style=paraiso-dark" >}}fmt.Println("inline"){{< /highlight >}} code.</p>
     </article>
index 9a78a8d7e7bb0fe0b3002f10a0c1cba7fbc06a74..b949008390b25b2d3cbaf63f0e8397b80dffaba1 100644 (file)
@@ -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