nexT

记录下本网站所用hexo主题nexT

主题安装(git)

前提:已有hexo环境,且位于hexo根目录下

Downloading NexT

1
git clone https://github.com/next-theme/hexo-theme-next themes/next

主题文件固定是在hexo根目录下themes/next目录中

Upgrading NexT

1
2
cd themes/next
git pull origin master

也可以指定其他分支或者tag

Configuration Files

1
2
# Installed through Git
cp themes/next/_config.yml _config.next.yml

将主题参考的配置文件复制到hexo根目录下,hexo默认会加载_config.[theme].yml文件的配置,且优先级大于_config.yml

Hexo Configuration

根据需要更新_config.[theme].yml文件的配置

Enabling NexT

1
theme: next

将根目录下_config.ymltheme更改为next即可启用本主题

nexT内置插件

Centered Quote

  • 例子

    1
    {% cq %}Something{% endcq %}
  • 效果

    Something

video

  • 语法

    1
    {% video url %}
  • 例子

    1
    {% video /video/a_3yEjZN5C5EzV1555320018.mp4 %}
  • 效果

button

  • 语法

    1
    2
    3
    {% button url, text, icon [class], [title] %}
    # or
    {% btn url, text, icon [class], [title] %}
  • 例子

    1
    2
    3
    4
    5
    6
    {% btn #, Text %}
    {% btn #, Text & Title,, Title %}
    {% btn #,, home %}
    {% btn #, Text & Large Icon, home fa-fw fa-lg %}
    {% btn #, Text & Large Icon & Title, home fa-fw fa-lg, Title %}
    <div class="text-center">{% btn https://github.com, GitHub, fab fa-github fa-fw fa-lg, GitHub %}</div>
  • 效果

    Text Text & Title Text & Large Icon Text & Large Icon & Title

caniuse

  • 语法

    1
    2
    3
    {% caniuse feature @ [periods] %}
    # or
    {% can feature @ [periods] %}
  • 例子

    1
    2
    3
    4
    {% caniuse fetch %}
    {% caniuse sharedarraybuffer @ current %}
    {% caniuse loading-lazy-attr @ future_3,future_2,future_1 %}

  • 效果

Group Pictures

  • 语法

    1
    2
    3
    4
    5
    {% grouppicture [number]-[layout] %}
    {% endgrouppicture %}
    # or
    {% gp [number]-[layout] %}
    {% endgp %}

    具体排列效果如下:

  • 例子

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {% grouppicture 3-3 %}
    ![](/images/next.png)
    ![](/images/next.png)
    ![](/images/next.png)
    {% endgrouppicture %}

    {% gp 5-2 %}
    ![](/images/next.png)
    ![](/images/next.png)
    ![](/images/next.png)
    ![](/images/next.png)
    ![](/images/next.png)
    {% endgp %}


  • 效果

label

  • 语法

    1
    {% label [class]@text %}
  • 例子

    1
    2
    3
    4
    5
    6
    {% label @default %}
    {% label primary@primary %}
    {% label success@success %}
    {% label info@info %}
    {% label warning@warning %}
    {% label danger@danger %}
  • 效果

    default primary success info warning danger
  • 语法

    1
    2
    {% mermaid type %}
    {% endmermaid %}
  • 例子

    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]
    
    

Tabs

  • 语法

    1
    2
    3
    4
    5
    6
    {% tabs Unique name, [index] %}
    <!-- tab [Tab caption] [@icon] -->
    Any content (support inline tags too).
    <!-- endtab -->
    {% endtabs %}

  • 例子

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {% tabs First unique name %}
    <!-- tab -->
    **This is Tab 1.**
    <!-- endtab -->

    <!-- tab -->
    **This is Tab 2.**
    <!-- endtab -->

    <!-- tab -->
    **This is Tab 3.**
    <!-- endtab -->
    {% endtabs %}

  • 效果

    This is Tab 1.

    This is Tab 2.

    This is Tab 3.

Note

  • 语法

    1
    2
    3
    {% note [class] [no-icon] [summary] %}
    Any content (support inline tags too).
    {% endnote %}
  • 例子

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    {% note %}
    #### Header
    (without define class style)
    {% endnote %}

    {% note default %}
    #### Default Header
    Welcome to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note default %}
    #### Default Header
    Welcome to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note primary %}
    #### Primary Header
    **Welcome** to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note info %}
    #### Info Header
    **Welcome** to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note success %}
    #### Success Header
    **Welcome** to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note warning %}
    #### Warning Header
    **Welcome** to [Hexo!](https://hexo.io)
    {% endnote %}

    {% note danger %}
    #### Danger Header
    **Welcome** to [Hexo!](https://hexo.io)
    {% endnote %}

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

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

    {% 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 %}

    {% note default %}
    #### Lists in note
    * ul
    * ul
    * ul
    * ul
    * ul

    1. ol
    2. ol
    1. ol
    2. ol
    3. ol
    {% endnote %}

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

  • 效果

    (without define class style)

    Default Header

    Welcome to Hexo!

    Default Header

    Welcome to Hexo!

    Primary Header

    Welcome to Hexo!

    Info Header

    Welcome to Hexo!

    Success Header

    Welcome to Hexo!

    Warning Header

    Welcome to Hexo!

    Danger Header

    Welcome to Hexo!

    No icon note

    Note without icon: note info no-icon

    This is a summary

    Details and summary

    Note with summary: note primary This is a summary

    This is a summary

    Details and summary (No icon)

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

    Codeblock in note

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

    Lists in note

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

    Table in Note

    1 2
    3 4
    5 6
    7 8