本文提供了可在 Hugo 內容檔案中使用的基本 Markdown 語法範例,也展示了 Hugo 主題中是否使用 CSS 裝飾基本 HTML 元素
Headings 標題
以下 HTML <h1>—<h6> 代表六個階級的章節標題 <h1> 最大 <h6> 最小
H1
H2
H3
H4
H5
H6
Paragraph 段落
內文在說故事,砍了…
Blockquotes 區塊引用
blockquote 元素表示從其他來源引用的內容可選地帶有必須位於or元素內的引文 footer or cite 並且可選地帶有內聯更改(例如註釋和縮寫)
Blockquote without attribution 沒有歸屬的區塊引用
然後,為了鑄造安達普,要給予的知識會被相應地削減
注意,可以在區塊引用中使用Markdown 語法
Blockquote with attribution 有歸屬的區塊引用
不要透過共享記憶體來通信,而是透過通信來共享記憶體
— Rob Pike1
Tables 表格
表格不是核心 Markdown 規範的一部分,但 Hugo 支援開箱即用地支援它們
| Name | Age |
|---|---|
| Bob | 27 |
| Alice | 23 |
表格內內聯 Markdown
| Italics | Bold | Code |
|---|---|---|
| italics | bold | code |
| A | B | C | D | E | F |
|---|---|---|---|---|---|
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. | Phasellus ultricies, sapien non euismod aliquam, dui ligula tincidunt odio, at accumsan nulla sapien eget ex. | Proin eleifend dictum ipsum, non euismod ipsum pulvinar et. Vivamus sollicitudin, quam in pulvinar aliquam, metus elit pretium purus | Proin sit amet velit nec enim imperdiet vehicula. | Ut bibendum vestibulum quam, eu egestas turpis gravida nec | Sed scelerisque nec turpis vel viverra. Vivamus vitae pretium sapien |
Code Blocks 程式碼區塊
Code block with backticks 帶有反引號的程式碼區塊
|
|
Code block indented with four spaces 程式碼區塊縮排四個空格
<!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 帶有 Hugo 內部高亮短代碼的程式碼區塊
|
|
Diff code block 差異代碼區塊
|
|
List Types 清單類型
Ordered List 有序列表
- First item
- Second item
- Third item
Unordered List 無序列表
- List item
- Another item
- And another item
Nested list 嵌套列表
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
Other Elements 其他元素 — abbr, sub, sup, kbd, mark
GIF is a bitmap image format.
H2O
Xn + Yn = Zn
Press CTRL + ALT + Delete to end the session.
Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.
