使用时删除 {{ 和 }} 中间的 \
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 罗列数据后使用 id 或 ref 参数:
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 罗列数据后使用 group 或 category 参数:
BASH
1{\{< link group="social" >}\}
2{\{< link category="social" >}\}注意
icon 参数不是必须的, 如果未指定值, 模板会寻找链接的 favicon 文件(.svg/.ico), 如果仍未找到可用的值, 会回退到 assets 目录下的 link.svg 文件。
按钮
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:链接地址(必需)。variant:primary、secondary、outline(默认:primary)。size:sm、md、lg(默认: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,需要在本地编译样式应用到主题。