HEXO-NEXT进阶~标签使用

一、Button 按钮

text

或者

text

说明:

  • url : Absolute or relative path to URL.
  • text : Button text. Required if no icon specified.
  • icon : Font Awesome icon name. Required if no text specified.
  • [class] : Optional parameter. Font Awesome class(es): fa-fw | fa-lg | fa-2x | fa-3x | fa-4x | fa-5x
  • [title] : Optional parameter. Tooltip at mouseover.

应用实例:

1
{% button #, Text %}
Text

1.文字标签按钮:

1
{% btn #, Text %}{% btn #, Text & Title,, Title %}
TextText & Title
1
{% btn #, Text %} {% btn #, Text & Title,, Title %}
Text Text & Title
1
2
{% btn #, Text %}
{% btn #, Text & Title,, Title %}
Text Text & Title

2.图标按钮:

1
2
3
4
5
6
{% btn #,, home fa-5x %}
{% btn #,, home fa-4x %}
{% btn #,, home fa-3x %}
{% btn #,, home fa-2x %}
{% btn #,, home fa-lg %}
{% btn #,, home %}

3.文字&图标按钮

1
2
{% btn #, Text & Icon (buggy), home %}
{% btn #, Text & Icon (fixed width), home fa-fw %}
Text & Icon (buggy) Text & Icon (fixed width)
1
2
{% btn #, Text & Large Icon, home fa-fw fa-lg %}
{% btn #, Text & Large Icon & Title, home fa-fw fa-lg, Title %}
Text & Large Icon Text & Large Icon & Title

4.在文字中使用

1
2
3
Lorem {% btn #, Lorem, home fa-fw fa-lg %} ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident {% btn #, Ipsum, home fa-fw fa-lg %}, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident Ipsum, sunt in culpa qui officia deserunt mollit anim id est laborum.

5.在其它标签中使用按钮

1
2
3
4
5
6
7
{% note info %}
{% btn #, Text & Icon, home fa-fw %}

{% btn #,, home, Title %}{% btn #, Text %}

[Link](#)
{% endnote %}

6.按钮框设计

1
2
3
{% btn #,, heading %}{% btn #,, fab fa-edge %}{% btn #,, times %}{% btn #,, circle-notch %}
{% btn #,, italic %}{% btn #,, fab fa-scribd %}
{% btn #,, fab fa-google %}{% btn #,, fab fa-chrome %}{% btn #,, fab fa-opera %}{% btn #,, gem fa-rotate-270 %}

7.按钮相对URL链接

1
<div class="text-center">{% btn #, Previous Chapter, arrow-left fa-fw fa-lg, Previous Chapter (Full Image) %} {% btn #, Next Chapter, arrow-right fa-fw fa-lg, Next Chapter (Label) %}</div>

8.按钮绝对URL链接

1
<div class="text-center">{% btn https://github.com, GitHub, fab fa-github fa-fw fa-lg, GitHub %}</div>

二、Caniuse 统计图

Caniuse with past periods

1
{% caniuse link-rel-modulepreload @ past_1,past_2,past_3,past_4,past_5 %}

三、Group Pictures

格式

1
2
{% grouppicture [number]-[layout] %}
{% endgrouppicture %}

用法:

  • [number] : Optional parameter. Total number of pictures to add in the group pictures.
  • [layout] : Optional parameter. The index of the layout, which can be obtained according to the figure below. For example, if you want to apply the second layout to 4 pictures, then use

实例:

1
{% grouppicture 4-2 %}{% endgrouppicture %}

四、Label 标注

代码实例:

1
2
3
4
5
6
Lorem {% label @ipsum %} {% label primary@dolor sit %} amet, consectetur {% label success@adipiscing elit, %} sed {% label info@do eiusmod %} tempor incididunt ut labore et dolore magna aliqua.

Ut enim *{% label warning @ad %}* minim veniam, quis **{% label danger@nostrud %}** exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate ~~{% label default @velit %}~~ <mark>esse</mark> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

效果展示:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

格式:

1
2
{% linkgrid [image] [delimiter] [comment] %}
{% endlinkgrid %}
  • [image] : Optional parameter. Default image URL.
  • [delimiter] : Optional parameter. If the optional delimiter parameter is given, it is interpreted as the delimiter of items in each line.
  • [comment] : Optional parameter. If the optional comment parameter is given, it is interpreted as the symbol to comment out a line.

代码:

1
2
3
4
5
6
7
{% linkgrid %}
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
% Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
{% endlinkgrid %}

六、Note 重点标签标注

Docker HEXO spurin/hexo 自带

NexT config file 设置
1
2
3
4
5
6
7
8
9
10
11
note:
# Note tag style values:
# - simple bs-callout old alert style. Default.
# - modern bs-callout new (v2-v3) alert style.
# - flat flat callout style with background, like on Mozilla or StackOverflow.
# - disabled disable all CSS styles import of note tag.
style: simple
icons: false
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
# Offset also applied to label tag variables. This option can work with disabled note tag.
light_bg_offset: 0
用法
1
2
3
{% note [class] [no-icon] [summary] %}
Any content (support inline tags too).
{% endnote %}
  • [class] : Optional parameter. Supported values: default | primary | success | info | warning | danger.
  • [no-icon] : Optional parameter. Disable icon in note.
  • [summary] : Optional parameter. Optional summary of the note.
应用实例

1.Header

1
2
3
4
5
6
{% note %}

#### Header

(without define class style)
{% endnote %}

(without define class style)

2.Default Header

1
2
3
4
5
6
{% note default %}

#### Default Header

Welcome to [Hexo!](https://hexo.io)
{% endnote %}

Default Header

Welcome to Hexo!

3.Primary Header

1
2
3
4
5
6
{% note primary %}

#### Primary Header

**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

Primary Header

Welcome to Hexo!

4.Info Header

1
2
3
4
5
6
{% note info %}

#### Info Header

**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

Info Header

Welcome to Hexo!

5.Success Header

1
2
3
4
5
6
{% note success %}

#### Success Header

**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

Success Header

Welcome to Hexo!

6.Warning Header

1
2
3
4
5
6
{% note warning %}

#### Warning Header

**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

Warning Header

Welcome to Hexo!

7.Danger Header

1
2
3
4
5
6
{% note danger %}

#### Danger Header

**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

Danger Header

Welcome to Hexo!

8.No icon note

1
2
3
4
5
6
{% note info no-icon %}

#### No icon note

Note **without** icon: `note info no-icon`
{% endnote %}

No icon note

Note without icon: note info no-icon

9.Details and summary

1
2
3
4
5
6
{% note primary This is a summary %}

#### Details and summary

Note with summary: `note primary This is a summary`
{% endnote %}

This is a summary

Details and summary

Note with summary: note primary This is a summary

10.Details and summary (No icon)

1
2
3
4
5
6
{% note info no-icon This is a summary %}

#### Details and summary (No icon)

Note with summary: `note info no-icon This is a summary`
{% endnote %}

This is a summary

Details and summary (No icon)

Note with summary: note info no-icon This is a summary

11.Codeblock in note

1
2
3
4
5
6
7
8
9
10
{% note success %}

#### Codeblock in note

```
code block in note tag
code block in note tag
code block in note tag
```
{% endnote %}

Codeblock in note

1
2
3
code block in note tag
code block in note tag
code block in note tag

12.Lists in note

Lists in note

  • ul
  • ul
    • ul
    • ul
  • ul
  1. ol
  2. ol
    1. ol
    2. ol
  3. ol

13.Table in Note

1
2
3
4
5
6
7
{% note default %}
| 1 | 2 |
| - | - |
| 3 | 4 |
| 5 | 6 |
| 7 | 8 |
{% endnote %}
1 2
3 4
5 6
7 8

七、PDF 用法

NexT config file 设置

1
2
3
4
pdf:
enable: true
Default height
height: 500px

用法

八、Mermaid 思维导图

用法

NexT config file

1
2
3
4
5
6
7
# Mermaid tag
mermaid:
enable: true
# Available themes: default | dark | forest | neutral
theme:
light: default
dark: dark

Hexo config file

1
2
3
highlight:
exclude_languages:
- mermaid

格式:

1
2
{% mermaid type %}
{% endmermaid %}

或者:

1
2
3
4
```mermaid
type

```

实例

1
2
3
4
5
6
{% mermaid graph TD %}
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
{% endmermaid %}
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
1
2
3
4
5
6
7
8
9
10
{% mermaid sequenceDiagram %}
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
{% endmermaid %}
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
    John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
1
2
3
4
5
6
7
8
9
10
{% mermaid gantt %}
dateFormat YYYY-MM-DD
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
{% endmermaid %}
gantt
dateFormat  YYYY-MM-DD
section Section
Completed :done,    des1, 2014-01-06,2014-01-08
Active        :active,  des2, 2014-01-07, 3d
Parallel 1   :         des3, after des1, 1d
Parallel 2   :         des4, after des1, 1d
Parallel 3   :         des5, after des3, 1d
Parallel 4   :         des6, after des4, 1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{% mermaid classDiagram %}
Class01 <|-- AveryLongClass : Cool
<<interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<<service>>
int id
size()
}
{% endmermaid %}
classDiagram
Class01 <|-- AveryLongClass : Cool
<<interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
  <<service>>
  int id
  size()
}
1
2
3
4
5
6
7
8
{% mermaid stateDiagram %}
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
{% endmermaid %}
stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
1
2
3
4
5
{% mermaid pie %}
"Dogs" : 386
"Cats" : 85
"Rats" : 15
{% endmermaid %}
pie
"Dogs" : 386
"Cats" : 85
"Rats" : 15
1
2
3
4
5
6
7
8
9
10
{% mermaid journey %}
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
{% endmermaid %}
journey
title My working day
section Go to work
  Make tea: 5: Me
  Go upstairs: 3: Me
  Do work: 1: Me, Cat
section Go home
  Go downstairs: 5: Me
  Sit down: 3: Me

九、Quote 引用

用法

1
{% centerquote %}Something{% endcenterquote %}

或者

1
{% cq %}Something{% endcq %}

实例

1
{% cq %}Elegant in code, simple in core{% endcq %}

Elegant in code, simple in core

十、视频

用法

1
{% video url %}

实例

1
{% video https://example.com/sample.mp4 %}