A comprehensive showcase of all available shortcodes in HBStack and HugoMods frameworks, including Bootstrap components, extended media shortcodes, and modular features with examples and module import requirements.
A comprehensive showcase of all available shortcodes in HBStack and HugoMods frameworks, including Bootstrap components, extended media shortcodes, and modular features with examples and module import requirements.
Before using these shortcodes, ensure you have the following modules imported in your config/_default/module.yaml:
1imports:
2 # Custom modules
3 - path: github.com/agsayyed/ags-mcq
4 - path: github.com/agsayyed/ags-markmap
5 # gallery modules.
6 - path: github.com/hbstack/gallery
7 - path: github.com/hbstack/gallery/modules/breadcrumb
8 - path: github.com/hbstack/syntax-highlighting/styles/github-dark
9 - path: github.com/hugomods/shortcodes
10 - path: github.com/hbstack/shortcodes
11
12 # Bootstrap components for shortcodes
13 - path: github.com/hugomods/bootstrap
14 - path: github.com/hbstack/bootstrap
15 - path: github.com/gohugoio/hugo-mod-bootstrap-scss/v5
16
17 # Additional shortcode modules
18 - path: github.com/hugomods/encrypt
19 - path: github.com/hugomods/katex
20 - path: github.com/hugomods/mermaid
21 - path: github.com/hugomods/video-js
22 - path: github.com/hugomods/kroki
23 - path: github.com/hugomods/echarts
24
25 # Core modules
26 - path: github.com/hugomods/hugopress
27 # syntax highlighting, see https://hbstack.dev/en/docs/modules/syntax-highlighting/.
28
29 # icons modules
30 - path: github.com/hugomods/icons/vendors/font-awesome
31 - path: github.com/hugomods/icons/vendors/bootstrap
32 # - path: github.com/hugomods/icons/vendors/mdi
33 # - path: github.com/hugomods/icons/vendors/simple-icons
34 # - path: github.com/hugomods/icons/vendors/tabler
35 # - path: github.com/hugomods/icons/vendors/feather
36
37 # header themes
38 - path: github.com/hbstack/header/themes/pills
39 # - path: github.com/hbstack/header/themes/tabs
40 # - path: github.com/hbstack/header/themes/classic
41
42 # blog sidebar
43 - path: github.com/hbstack/blog/modules/sidebar/profile
44 - path: github.com/hbstack/blog/modules/sidebar/posts
45 - path: github.com/hbstack/blog/modules/sidebar/taxonomies
46
47 # blog comments engine
48 - path: github.com/hbstack/blog/modules/giscus
49 # - path: github.com/hbstack/blog/modules/disqus
50 # - path: github.com/hbstack/blog/modules/utterances
51
52 # blog table of contents scrollspy
53 - path: github.com/hbstack/blog/modules/toc-scrollspy
54
55 # blog content panel
56 - path: github.com/hbstack/blog/modules/content-panel
57
58 # docs comments engine
59 - path: github.com/hbstack/docs/modules/giscus
60 # - path: github.com/hbstack/docs/modules/utterances
61 # - path: github.com/hbstack/docs/modules/disqus
62
63 # docs table of contents scrollspy
64 - path: github.com/hbstack/docs/modules/toc-scrollspy
65
66 # docs content panel
67 - path: github.com/hbstack/docs/modules/content-panel
68
69 # other modules
70 # - path: github.com/hugomods/google-analytics
71 # - path: github.com/hugomods/google-adsense
72
73 # recommended modules
74 # check which modules were imported by recommended module by "hugo mod graph | grep recommended".
75 # see also https://hbstack.dev/en/docs/modules/meta/.
76 # to remove unused modules, you need to replace the recommended module with modules your need.
77 # see also https://hbstack.dev/en/2023/10/replace-meta-modules/.
78 - path: github.com/hbstack/meta/recommended
Module Required: github.com/hugomods/bootstrap
1{{\< bs/alert >}}Basic alert{{\< /bs/alert >}}
2{{\< bs/alert primary >}}Primary alert{{\< /bs/alert >}}
3{{\< bs/alert success >}}Success alert{{\< /bs/alert >}}
4{{\< bs/alert warning >}}Warning alert{{\< /bs/alert >}}
5{{\< bs/alert danger >}}Danger alert{{\< /bs/alert >}}
Module Required: github.com/hugomods/bootstrap
This is a lead paragraph that stands out from regular text. It's perfect for introductions and important information.
You can also add custom classes to style the lead paragraph differently.
1{{\% bs/lead %}}
2Your lead text here.
3{{\% /bs/lead %}}
4
5{{\% bs/lead class="text-primary" %}}
6Lead with custom styling.
7{{\% /bs/lead %}}
Module Required: github.com/hugomods/bootstrap
This content is hidden by default and can be toggled by clicking the button above.
You can include any markdown content here:
1{{\< bs/collapse "Button Text" >}}
2Hidden content goes here.
3{{\< /bs/collapse >}}
Module Required: github.com/hugomods/bootstrap
The accordion shortcode requires a data file. Create a YAML file in your data directory:
1# data/example/faq.yaml
2- title: 'What is HBStack?'
3 content: 'HBStack is a modular Hugo framework built on Bootstrap for creating fast, responsive websites.'
4
5- title: 'How do I install modules?'
6 content: 'Add the module path to your config/_default/module.yaml file under the imports section.'
1{{\% bs/accordion "data.file.path" %}}
Module Required: github.com/hugomods/bootstrap
1{{\< bs/ratio 16x9 >}}
2{{\< youtube VIDEO_ID >}}
3{{\< /bs/ratio >}}
Module Required: github.com/hugomods/bootstrap
1
Large Display Heading
2
Medium Display Heading
Module Required: github.com/hugomods/bootstrap
Demonstrates configuration in different formats with a title:
config.toml
1baseURL = '<https://example.com>'
2title = 'My Site'
3[params]
4 author = 'John Doe'
5 description = 'A Hugo site using HBStack'
config.yaml
1baseURL: <https://example.com>
2params:
3 author: John Doe
4 description: A Hugo site using HBStack
5title: My Site
config.json
1{
2 "baseURL": "\u003chttps://example.com\u003e",
3 "params": {
4 "author": "John Doe",
5 "description": "A Hugo site using HBStack"
6 },
7 "title": "My Site"
8}
With a specific style and languages:
Module Required: github.com/hugomods/bootstrap + github.com/hugomods/icons/vendors/font-awesome
Requires data file:
1# data/example/features.yaml
2- icon:
3 vendor: fas
4 name: rocket
5 color: primary
6 title: 'Fast Performance'
7 description: 'Built for speed with optimized assets and efficient rendering'
8- icon:
9 vendor: fas
10 name: shield
11 color: success
12 title: 'Secure & Reliable'
13 description: 'Security-first approach with best practices built-in'
14- icon:
15 vendor: fas
16 name: mobile-screen
17 color: info
18 title: 'Mobile Responsive'
19 description: "Looks great on all devices with Bootstrap's responsive grid"
20- icon:
21 vendor: fas
22 name: puzzle-piece
23 color: warning
24 title: 'Modular Architecture'
25 description: "Add only the features you need with Hugo's module system"
Module Required: github.com/hugomods/bootstrap
Here’s another example with different colors and a nested grid:
This column takes up 8 columns of the 12-column grid. The content is styled with:
A smaller column that demonstrates:
Example code:
1{{< bs/container class="bg-light p-4 rounded-3 border mb-3" >}}
2{{< bs/row class="g-4" >}}
3{{< bs/col 6 >}}
4{{< html/tag _name="div" class="p-4 bg-primary text-white rounded shadow-sm" >}}
5
6<h4>First Column</h4>
7<ul class="mb-0">
8<li>Styled with primary background</li>
9<li>Responsive width (6/12)</li>
10<li>Custom padding and shadow</li>
11<li>Supports markdown content</li>
12</ul>
13{{< /html/tag >}}
14{{< /bs/col >}}
15{{< bs/col 6 >}}
16{{< html/tag _name="div" class="p-4 bg-success text-white rounded shadow-sm" >}}
17
18<h4>Second Column</h4>
19<ul class="mb-0">
20<li>Styled with success background</li>
21<li>Equal width as first column</li>
22<li>Consistent styling</li>
23<li>Shows grid flexibility</li>
24</ul>
25{{< /html/tag >}}
26{{< /bs/col >}}
27{{< /bs/row >}}
28{{< /bs/container >}}
Module Required: github.com/hugomods/shortcodes
1{{< codepen id="PEN_ID" >}}
2{{< codepen id="PEN_ID" user="USERNAME" >}}
1{{< jsfiddle id="FIDDLE_ID" >}}
2{{< jsfiddle id="FIDDLE_ID" user="USERNAME" >}}
1{{< jsrun id="RUN_ID" >}}
Module Required: github.com/hugomods/shortcodes
1{{< bilibili 4792031027134976 >}}
1{{<id="XNjQ2NjU4MDkxMg==" >}}
1{{< asciinema CAST_ID >}}
2{{< asciinema 473695 >}} <!-- Basic usage -->
3{{< asciinema id="473695" speed="2" >}} <!-- 2x playback speed -->
4{{< asciinema id="473695" rows="30" cols="80" >}} <!-- Custom terminal size -->
1{{< netease-cloud-music id="SONG_ID" >}}
2{{< netease-cloud-music id="PLAYLIST_ID" type="playlist" >}}
Module Required: github.com/hugomods/shortcodes
This content is hidden inside a details element. It’s semantic HTML that works without JavaScript.
Here are some key features:
Inline code blocksYou can include any markdown content here:
First item in ordered list
Second item shows code example:
1print("Hello from a code block!")
Third item with nested content:
And blockquotes work perfectly too!
Even multi-line quotes render correctly.
Additional formatting examples:
1{{% details "Summary text" %}}
2Hidden content here.
3{{% /details %}}
Module Required: github.com/hugomods/shortcodes
NOte, to get the correct formatting it is to be palced in codeblock
1{ { < file-content "data/files/config.yaml" > } }
assets directory1
This reads content from files in your assets, static, or content directories.
1{{\< file-content "path/to/file.txt" >}}
2{{\< file-content path="config.yaml" lang="yaml" >}}
Module Required: github.com/hugomods/shortcodes
Create abbreviations with tooltips:
Requires data file:
1# data/abbr.yaml
2HTML: 'HyperText Markup Language'
3CSS: 'Cascading Style Sheets'
1{{< abbr "HTML" >}}
2{{< abbr "CSS" "Custom tooltip" >}}
Module Required: github.com/hugomods/shortcodes
The env shortcode is primarily used to read sensitive or configurable information from environment variables. This is particularly useful for:
Use Case Example: When your site repository is public, you might want to avoid hardcoding personal contact information. Instead, store it in environment variables:
1Contact: {{% env "CONTACT_EMAIL" "contact@example.com" %}}
GitHub Actions Example: When using GitHub Actions for deployment, store sensitive information in GitHub Secrets and pass them as environment variables:
1# .github/workflows/deploy.yml
2env:
3 CONTACT_EMAIL: ${{ secrets.CONTACT_EMAIL }}
4 SITE_DOMAIN: ${{ secrets.SITE_DOMAIN }}
Common Usage Examples:
Basic usage:
1{{% env "CI" %}} # Check if running in CI environment
With default fallback:
1{{% env "HUGO_ENV" "development" %}} # Uses "development" if HUGO_ENV is not set
Real-world examples:
1Site Domain: {{% env "SITE_DOMAIN" "localhost:1313" %}}
2API Key: {{% env "API_KEY" "demo-key" %}}
3Contact: {{% env "CONTACT_EMAIL" "contact@example.com" %}}
Common Environment Variables:
HUGO_ENV: Current Hugo environment (development/production)HUGO_VERSION: Hugo version being usedCI: Whether running in a CI environmentNETLIFY: Whether running on NetlifyVERCEL: Whether running on VercelModule Required: github.com/hugomods/bootstrap
The clearfix shortcode helps clear floated elements. Here’s an example with floated images and text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id eleifend ex. Nunc vestibulum sapien quis dolor mollis, at efficitur eros tincidunt. Sed vulputate magna vitae enim sagittis, vel tincidunt nisi pellentesque. Praesent sit amet tempor purus.
Proin interdum risus vel orci convallis, vitae ultricies erat euismod. Nulla ultricies mi sem, id semper elit venenatis sit amet. Curabitur ultrices lobortis enim, tristique lacinia arcu accumsan eleifend. Suspendisse nec orci et nisi sagittis gravida.
1{{\% bootstrap/clearfix \%}}
2
3Left-floated content with text...
4
5
6Right-floated content with text...
7{{\% /bootstrap/clearfix \%}}
Note: The clearfix shortcode is particularly useful for:
Clearing floated images and content
Maintaining proper layout with float-based designs
Preventing content overlap
Ensuring container height includes all floated elements
Module Required: github.com/hugomods/shortcodes
Highlight text with a background colo
Module Required: github.com/hugomods/shortcodes
Access site parameters from your content:
1{{< params "site.title" >}} # Access site title
2{{< params "params.description" >}} # Access site description
Module Required: Multiple vendor modules:
github.com/hugomods/icons/vendors/font-awesomegithub.com/hugomods/icons/vendors/bootstrapgithub.com/hugomods/icons/vendors/mdigithub.com/hugomods/icons/vendors/simple-iconsgithub.com/hugomods/icons/vendors/tablergithub.com/hugomods/icons/vendors/featherHere are examples from different icon vendors:
Bootstrap Icons: house icon camera icon bell icon check-circle icon (with color) exclamation-triangle icon (with size)
Font Awesome Icons: rocket icon shield icon (with color) mobile-screen icon (with size) puzzle-piece icon GitHub brand icon Docker brand icon
Material Design Icons (MDI): home icon account-circle icon cog icon (with color) alert icon (with size)
Simple Icons: Hugo Markdown GitHub (with brand color) Docker (with brand color)
Feather Icons: home icon user icon settings icon (with color) alert-triangle icon (with size)
To use these icon sets, uncomment their respective module imports in config/_default/module.yaml:
1# icons modules
2- path: github.com/hugomods/icons/vendors/font-awesome
3- path: github.com/hugomods/icons/vendors/bootstrap
4- path: github.com/hugomods/icons/vendors/mdi
5- path: github.com/hugomods/icons/vendors/simple-icons
6# - path: github.com/hugomods/icons/vendors/tabler
7- path: github.com/hugomods/icons/vendors/feather
Code Examples:
Basic usage:
1{{< icons/icon vendor="bootstrap" name="house" >}}
With color:
1{{< icons/icon vendor="font-awesome" name="heart" color="red" >}}
With custom size:
1{{< icons/icon vendor="font-awesome" name="star" size="1.5em" >}}
Icon vendors and examples:
1# Bootstrap icons
2
3{{< icons/icon vendor="bootstrap" name="house" >}}
4{{< icons/icon vendor="bootstrap" name="camera" >}}
5{{< icons/icon vendor="bootstrap" name="bell" >}}
6
7# Font Awesome icons (fas = solid, fab = brands)
8
9{{< icons/icon vendor="fas" name="rocket" >}} # Solid icon
10{{< icons/icon vendor="fab" name="github" >}} # Brand icon
11{{< icons/icon vendor="fas" name="shield" color="success" >}} # With color
12
13# Material Design Icons (MDI)
14
15{{< icons/icon vendor="mdi" name="home" >}}
16{{< icons/icon vendor="mdi" name="account-circle" color="blue" >}}
17
18# Simple Icons (with brand colors)
19
20{{< icons/icon vendor="simple-icons" name="hugo" >}}
21{{< icons/icon vendor="simple-icons" name="github" color="#181717" >}}
22
23# Tabler Icons
24
25{{< icons/icon vendor="tabler" name="home" >}} # Basic home icon
26{{< icons/icon vendor="tabler" name="user" >}} # User icon
27{{< icons/icon vendor="tabler" name="settings" color="blue" >}} # Colored settings icon
28{{< icons/icon vendor="tabler" name="alert-circle" size="1.5em" >}} # Sized alert-circle icon
29
30# Feather Icons
31
32{{< icons/icon vendor="feather" name="home" >}}
33{{< icons/icon vendor="feather" name="settings" color="purple" >}}
34
35# Material Design Icons (MDI)
36
37{{< icons/icon vendor="mdi" name="account" >}}
38{{< icons/icon vendor="mdi" name="cog" >}}
39
40# Simple Icons
41
42{{< icons/icon vendor="simple-icons" name="github" >}}
43{{< icons/icon vendor="simple-icons" name="linkedin" >}}
44
45# Feather Icons
46
47{{< icons/icon vendor="feather" name="settings" >}}
48{{< icons/icon vendor="feather" name="mail" >}}
Module Required: github.com/hugomods/katex
1{{< katex >}}
2f(x) = \int\_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d\xi
3{{< /katex >}}
Module Required: github.com/hugomods/mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Process 1]
B -->|No| D[Process 2]
C --> E[End]
D --> E
1{{< mermaid >}}
2graph TD
3A[Start] --> B{Decision}
4B -->|Yes| C[Process 1]
5B -->|No| D[Process 2]
6{{< /mermaid >}}
Module Required: github.com/hugomods/encrypt
1{{< encrypt "your_password" >}}
2Secret content here.
3{{< /encrypt >}}
Module Required: github.com/hugomods/echarts
Create interactive charts using ECharts:
1{{< echarts data="example.echarts-basic" >}}{{< /echarts >}}
2
3# Or with inline JSON in a data file
4# Create data/example/chart.yaml with your configuration
5{{< echarts data="example.chart" >}}{{< /echarts >}}
Module Required: github.com/hugomods/video-js
Below is an example of the video-js shortcode using a sample video:
The shortcode can be used in multiple ways, shown below:
1{{< video-js src="/videos/demo.mp4" type="video/mp4" >}}
2
3{{< video-js src="/videos/demo.mp4" type="video/mp4" poster="/images/poster.jpg" controls=true preload="auto" >}}
The video-js shortcode accepts the following parameters:
| Parameter | Description |
|---|---|
src | Path to the video file (required) |
type | MIME type of the video (required) |
poster | Path to the poster image (optional) |
controls | Show video controls (optional, default: true) |
preload | Preload behavior (optional, “auto”/“metadata”/“none”) |
width | Video width in pixels (optional) |
height | Video height in pixels (optional) |
class | Additional CSS classes (optional) |
These are available by default in Hugo:
1{{< youtube VIDEO_ID >}}
2{{< youtube id="VIDEO_ID" autoplay="true" >}}
1{{< vimeo VIDEO_ID >}}
Hugo 0.24 Released: Big archetype update + @Netlify _redirects etc. file supporthttps://t.co/X94FmYDEZJ #gohugo #golang @spf13 @bepsays
— GoHugo.io (@GoHugoIO) June 21, 2017
1{{< tweet user="USERNAME" id="TWEET_ID" >}}
1{{< instagram POST_ID >}}
1{{< gist USERNAME GIST_ID >}}
2{{< gist USERNAME GIST_ID FILENAME >}}

A clean and professional workspace setup perfect for productivity
1{{< figure src="/images/backgrounds/workspace-demo.jpg" title="Modern Workspace" caption="A clean and professional workspace setup" alt="Modern workspace with laptop and plants" >}}
| |
Module Required: github.com/hugomods/shortcodes
html/voidThe html/void shortcode generates void HTML elements like input.
1{{< html/void _name="input" type="text" placeholder="Enter text" class="form-control" >}}
Module Required: github.com/hugomods/shortcodes
Embed JSFiddle examples.
1{{< jsfiddle user="razonyang" id="6cp7xof1" >}}
Module Required: github.com/hugomods/shortcodes
Embed CodePen examples.
1{{< codepen user="username" id="abcdef" >}}
Module Required: github.com/hugomods/video-js
Here’s a simple video player with default controls:
The shortcode accepts various parameters for customization. Here’s an example with additional attributes:
1# Basic usage with minimal parameters
2
3{{< video-js src="/videos/demo.mp4" type="video/mp4" controls="true" >}}
4
5# Advanced usage with all available parameters
6
7{{< video-js src="/videos/demo.mp4" type="video/mp4" poster="/images/poster.jpg" controls="true" width="640" height="360" preload="auto" class="rounded shadow-sm" >}}
Key features:
Module Required: github.com/hugomods/plausible-analytics
Add Plausible Analytics to your site:
1{{< plausible >}} <!-- Basic usage -->
2{{< plausible domain="example.com" >}} <!-- Custom domain -->
Configure in your site parameters:
1params:
2 plausible:
3 domain: your-domain.com
4 script_source: https://plausible.io/js/script.js
Module Required: github.com/hbstack/gallery
Example of a single image with lightbox functionality:
1{{< img-link src="/images/gallery/landscape1.jpg" alt="Beautiful Landscape" caption="A serene landscape view" >}}
Module Required: github.com/hugomods/bootstrap
Create responsive image grids using a data file:
The grid above uses this data file:
1# data/gallery/examples.yaml
2- src: '/images/gallery/landscape1.jpg'
3 alt: 'Beautiful Landscape'
4 caption: 'A serene landscape view'
5 title: 'Nature Scene 1'
6- src: '/images/gallery/landscape2.jpg'
7 alt: 'Another Landscape'
8 caption: 'Capturing natural beauty'
9 title: 'Nature Scene 2'
config/_default/config.yaml file:1markup:
2 goldmark:
3 parser:
4 attribute:
5 block: true
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Row 1 | Data 1 | Data 2 |
| Row 2 | Data 3 | Data 4 |
| Left | Center | Right |
|---|---|---|
| 1 | 2 | 3 |
| 1 | 2 | 3 |
| 1 | 2 | 3 |
| Heading 1 | Heading 2 |
|---|---|
top | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
{_align=top}
1| Heading 1 | Heading 2 |
2| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3| `top` | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
4
5{\_align=top}
| Name | Age | Role |
|---|---|---|
| Foo | 35 | Leader |
| Bar | 23 | Developer |
{_caption=“here is a caption for the table”}
1| Name | Age | Role |
2| ---- | :-: | :-------: |
3| Foo | 35 | Leader |
4| Bar | 23 | Developer |
5
6{\_caption="Members"}
| Primary Table |
|---|
| Foo |
| Bar |
{_style=primary}