Hextra v0.11 发布啦!🎉 查看更新内容

其他短代码

其中部分为Hugo内置短代码。 这些短代码稳定性较低,可能随时变更。

示例

default
 
border
 
color
 
link
 
icon
 

使用

默认

徽章
 

{{< badge "徽章" >}}

颜色

徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 

{{< badge content="徽章" >}}
{{< badge content="徽章" color="purple" >}}
{{< badge content="徽章" color="indigo" >}}
{{< badge content="徽章" color="blue" >}}
{{< badge content="徽章" color="green" >}}
{{< badge content="徽章" color="yellow" >}}
{{< badge content="徽章" color="amber" >}}
{{< badge content="徽章" color="orange" >}}
{{< badge content="徽章" color="red" >}}

徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 
徽章
 

{{< badge content="徽章" border=false >}}
{{< badge content="徽章" color="purple" border=false >}}
{{< badge content="徽章" color="indigo" border=false >}}
{{< badge content="徽章" color="blue" border=false >}}
{{< badge content="徽章" color="green" border=false >}}
{{< badge content="徽章" color="yellow" border=false >}}
{{< badge content="徽章" color="amber" border=false >}}
{{< badge content="徽章" color="orange" border=false >}}
{{< badge content="徽章" color="red" border=false >}}

变体

徽章
 
Releases
 

{{< badge content="徽章" icon="sparkles" >}}
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}

选项

姓名描述
content徽章的文字。
link徽章的链接。
icon徽章的图标。
color徽章的颜色。
gray (默认), purple, indigo, blue, green, yellow, amber, orange, red.
class徽章的等级。
border添加或删除边框 (默认:true).

YouTube

嵌入YouTube视频。

{{< youtube 视频ID >}}

效果:

更多信息,请参阅 Hugo 的 YouTube 短代码

PDF

通过PDF短代码可在内容中嵌入PDF文件。

{{< pdf "https://example.com/sample.pdf" >}}

也可将PDF文件置于项目目录中并使用相对路径。

{{< pdf "path/to/file.pdf" >}}

示例:

最后更新于