使用时删除 {{}} 中间的 \

Bilibili

BASH
1{\{< bilibili VIDEO_ID PART_NUMBER >}\}
点击展开查看更多

同时支持 AV 号和 BV 号,其中 PART_NUMBER 是可选参数,指定后展示对应分集。

腾讯视频

BASH
1{\{< tencent VIDEO_ID >}\}
点击展开查看更多

链接卡片

链接卡片支持三种方式使用。

直接使用参数

BASH
1{\{< link title="Google" description="世界上最大的搜索引擎。" url="https://google.com" icon="https://google.com/favicon.ico" >}\}
点击展开查看更多

使用 id 或 ref 参数

data/links.yaml 罗列数据后使用 idref 参数:

BASH
1{\{< link id="github" >}\}
2{\{< link ref="github" >}\}
点击展开查看更多
data/links.yaml
 1social:
 2  - id: github
 3    title: GitHub
 4    description: The world's largest code hosting platform.
 5    url: https://github.com
 6    icon: https://github.com/fluidicon.png
 7
 8  - id: linkedin
 9    title: LinkedIn
10    description: Career Social Network.
11    url: https://linkedin.com
12
13tool:
14  - id: vercel
15    title: Vercel
16    description: Deploy and Development Platform.
17    url: https://vercel.com
18    icon: https://vercel.com/favicon.ico
19
20  - id: netlify
21    title: Netlify
22    description: Deploy and Development Platform.
23    url: https://netlify.com
24    icon: https://netlify.com/favicon.ico
25
26  - id: github-pages
27    title: GitHub Pages
28    description: Static Pages Hosting.
29    url: https://pages.github.com
30    icon: https://github.com/fluidicon.png
点击展开查看更多

使用 group 或 category 参数

data/links.yaml 罗列数据后使用 groupcategory 参数:

BASH
1{\{< link group="social" >}\}
2{\{< link category="social" >}\}
点击展开查看更多

按钮

MARKDOWN
1{\{< button text="Learn More" url="/about" >}\}
2{\{< button text="GitHub" url="https://github.com" icon="github" target="\_self" >}\}
3{\{< button text="Download" url="/download" variant="outline" size="lg" >}\}
点击展开查看更多

参数:

  • text:按钮文字(必需,或使用内部内容)。
  • url:链接地址(必需)。
  • variantprimarysecondaryoutline(默认:primary)。
  • sizesmmdlg(默认:md)。
  • icon:图标名称。
  • target_blank_self(默认:_blank)。
  • rel:链接关系(_blank 时自动添加 noopener noreferrer)。

图标

显示 ~/assets/icons/ 目录下的图标:

MARKDOWN
1{\{< icon name="heart" >}\}
2{\{< icon name="github" size="lg" >}\}
3{\{< icon name="sun" class="text-primary" >}\}
点击展开查看更多

参数:

  • name: 图标名称(必需)- 查看 ~/assets/icons/ 了解可用图标 或者将自定义图放置在此目录下。
  • size: xs, sm, md, lg, xl, 2xl (默认:md)。
  • class: 自定义类名,可以用来更改颜色。

自定义短代码

~/layout/_shortcodes 目录下添加短代码模板,如果使用 Tailwind CSS,需要在本地编译样式应用到主题。

版权声明

作者: Hugo Narrow

链接: https://hugo-narrow-docs.vercel.app/zh-cn/docs/%E6%89%A9%E5%B1%95%E7%9F%AD%E4%BB%A3%E7%A0%81/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键