diff options
author | Chen Xianmin <xianmin12@gmail.com> | 2022-09-06 18:05:20 +0300 |
---|---|---|
committer | Chen Xianmin <xianmin12@gmail.com> | 2022-09-06 18:05:20 +0300 |
commit | b536c5903ef88df624abfbe231c07b0cd7207bb4 (patch) | |
tree | b31d80f79b385966c702b41e664b97dec30f8ace /exampleSite | |
parent | 679987c5d9883ea37b401ee6c194bd085b90bab4 (diff) |
fix: use new highlight option
See: https://gohugo.io/content-management/syntax-highlighting/
Diffstat (limited to 'exampleSite')
-rw-r--r-- | exampleSite/content/post/jane-theme-preview.md | 21 | ||||
-rw-r--r-- | exampleSite/full-config.toml | 22 |
2 files changed, 35 insertions, 8 deletions
diff --git a/exampleSite/content/post/jane-theme-preview.md b/exampleSite/content/post/jane-theme-preview.md index 5e9be72..91e0872 100644 --- a/exampleSite/content/post/jane-theme-preview.md +++ b/exampleSite/content/post/jane-theme-preview.md @@ -97,13 +97,24 @@ You can change the complete/incomplete state by click the checkbox before the it ## Syntax Highlighting +unset language: + ```js function helloWorld () { alert("Hello, World!") } ``` -```java +```text +plain text + +first line +second line +``` + +**choose different style:** + +```java {style=github} public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); @@ -111,6 +122,14 @@ public class HelloWorld { } ``` +{{< highlight java "style=vim">}} +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} +{{< / highlight >}} + ## Math Blocks You can render *LaTeX* mathematical expressions using **MathJax**. diff --git a/exampleSite/full-config.toml b/exampleSite/full-config.toml index 9642a6e..1535174 100644 --- a/exampleSite/full-config.toml +++ b/exampleSite/full-config.toml @@ -13,13 +13,6 @@ copyright = "" # default: author.name ↓ # 默认为下面配 enableGitInfo = true # use git commit log to generate lastmod record # 可根据 Git 中的提交生成最近更新记录。 # uglyURLs = true # more info: https://gohugo.io/content-management/urls/#ugly-urls -# Highlight options. -# See https://gohugo.io/content-management/syntax-highlighting/ -PygmentsCodeFences = true # Enable syntax highlighting with GitHub flavoured code fences -PygmentsUseClasses = true # Use CSS classes to format highlighted code -PygmentsCodefencesGuessSyntax = true -PygmentsOptions = "linenos=table" - # Enable author pages #[taxonomies] # author = "author" @@ -255,3 +248,18 @@ defaultContentLanguage = "en" # Default language to use [markup.goldmark] [markup.goldmark.renderer] unsafe = true + + # Highlight options. See https://gohugo.io/content-management/syntax-highlighting/ + [markup.highlight] + anchorLineNos = true + codeFences = true + guessSyntax = false + hl_Lines = '' + hl_inline = false + lineAnchors = '' + lineNoStart = 1 + lineNos = true + lineNumbersInTable = true + noHl = false + style = 'friendly' + tabWidth = 4 |