短代码

展示 Stack 主题支持的各种短代码。

Stack 主题还提供了一些自定义短代码来增强你的内容。

引用 (Quote)

quote 短代码允许你显示带有作者、来源和 URL 的引用。

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

一位名人, 他们写的书

用法

1
2
3
{{< quote author="作者名字" source="文章标题" url="https://example.com" >}}
这里是引用内容。
{{< /quote >}}

视频 (Video)

video 短代码允许你嵌入自托管或远程视频文件。

用法

1
{{< video src="https://example.com/video.mp4" >}}

Bilibili

嵌入来自 Bilibili 的视频。支持 avbv 号。

用法

1
{{< bilibili "BV1634y1t7xR" >}}

YouTube

Hugo 内置的 YouTube 短代码。

用法

1
{{< youtube ZJthWmvUzzc >}}

腾讯视频 (Tencent Video)

嵌入来自腾讯视频的视频。

用法

1
{{< tencent "u00306ng962" >}}

GitLab Snippet

嵌入来自 GitLab 的代码片段。

用法

1
{{< gitlab 2349278 >}}

图表 (Diagrams)

Stack 出箱即用地支持 Mermaid 图表。

  graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;

用法

将你的 Mermaid 代码包裹在语言设置为 mermaid 的代码块中。

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计