docs: update code block sample

This commit is contained in:
ZhenShuo Leo
2025-12-15 21:17:57 +08:00
parent ff9a860af9
commit f487e616bf
4 changed files with 18 additions and 74 deletions
@@ -65,7 +65,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
## Code Blocks ## Code Blocks
### Code block with backticks ### General code block
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
@@ -80,23 +80,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html> </html>
``` ```
### Code block indented with four spaces ### Code block with title and line highlight
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
### Code block with Hugo's internal highlight shortcode
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@@ -107,7 +93,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
<p>Test</p> <p>Test</p>
</body> </body>
</html> </html>
{{< /highlight >}} ```
## List Types ## List Types
@@ -80,34 +80,20 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
</html> </html>
``` ```
### 4スペースのインデントによるコードブロック ### タイトルと行ハイライト機能付きのコードブロック
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>HTML5 資料の例</title>
</head>
<body>
<p>テスト</p>
</body>
</html>
### Hugo 内のショートコード・ハイライトを利用したコードブロック
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ja"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>HTML5 資料の例</title> <title>Example HTML5 Document</title>
</head> </head>
<body> <body>
<p>テスト</p> <p>Test</p>
</body> </body>
</html> </html>
{{< /highlight >}} ```
## リスト形式 ## リスト形式
+4 -18
View File
@@ -65,7 +65,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
## Code Blocks ## Code Blocks
### Code block with backticks ### General code block
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
@@ -80,23 +80,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html> </html>
``` ```
### Code block indented with four spaces ### Code block with title and line highlight
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
### Code block with Hugo's internal highlight shortcode
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@@ -107,7 +93,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
<p>Test</p> <p>Test</p>
</body> </body>
</html> </html>
{{< /highlight >}} ```
## List Types ## List Types
@@ -65,7 +65,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
## 代码块 ## 代码块
### 带反引号的代码块 ### 一般的代码块
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
@@ -80,23 +80,9 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
</html> </html>
``` ```
### 缩进四个空格的代码块 ### 带有标题和行高亮的代码块
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
### 带有 Hugo 内部高亮简码的代码块
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@@ -107,7 +93,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
<p>Test</p> <p>Test</p>
</body> </body>
</html> </html>
{{< /highlight >}} ```
## 列表 ## 列表