Shortcodes

Sample article showcasing various shortcodes supported by Stack theme.

Stack theme also provides some custom shortcodes to enhance your content.

Quote

The quote shortcode allows you to display a quote with an author, source, and URL.

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

A famous person, The book they wrote

Usage

1
2
3
{{< quote author="Author Name" source="Source Title" url="https://example.com" >}}
Quote content here.
{{< /quote >}}

Video

The video shortcode allows you to embed self-hosted or remote video files.

Usage

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

Bilibili

Embed videos from Bilibili. Supports both av and bv IDs.

Usage

1
{{< bilibili "BV1634y1t7xR" >}}

YouTube

Hugo’s built-in YouTube shortcode.

Usage

1
{{< youtube ZJthWmvUzzc >}}

Tencent Video

Embed videos from Tencent Video.

Usage

1
{{< tencent "u00306ng962" >}}

GitLab Snippet

Embed snippets from GitLab.

Usage

1
{{< gitlab 2349278 >}}

Diagrams

Stack supports Mermaid diagrams out of the box.

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

Usage

Wrap your Mermaid code in a code block with the language set to mermaid.

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy