Delete the \ between {{ and }}.

Bilibili

BASH
1{\{< bilibili VIDEO_ID PART_NUMBER >}\}
Click to expand and view more

Support AV number or BV number, PART_NUMBER is optinal, specifies which part to display when provided.

Tencent Video

BASH
1{\{< tencent VIDEO_ID >}\}
Click to expand and view more

Link cards support three methods to import.

Use parameters directly

BASH
1{\{< link title="Google" description="The world largest search engine." url="https://google.com" icon="https://google.com/favicon.ico" >}\}
Click to expand and view more

Use id or ref paremeter

List data at data/links.yaml, then use id or ref parameter:

BASH
1{\{< link id="github" >}\}
2{\{< link ref="github" >}\}
Click to expand and view more
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
Click to expand and view more

Use group or category parameter

List data at data/links.yaml, then use group or category parameter:

BASH
1{\{< link group="social" >}\}
2{\{< link category="social" >}\}
Click to expand and view more

Button

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" >}\}
Click to expand and view more

Parameters:

  • text: Button text (required, or use inner content)
  • url: Link address (required)
  • variant: primary, secondary, outline (default: primary)
  • size: sm, md, lg (default: md)
  • icon: Theme icon name
  • target: _blank, _self (default: _blank)
  • rel: Link relationship (noopener noreferrer is automatically added when _blank is used)

Icon

Display SVG icons from the ~/assets/icons/ directory:

MARKDOWN
1{\{< icon name="heart" >}\}
2{\{< icon name="github" size="lg" >}\}
3{\{< icon name="sun" class="text-primary" >}\}
Click to expand and view more

Parameters:

  • name: Icon name (required) - Check assets/icons/ for available icons or place custom icons in this directory, or place the custom icon in this directory
  • size: xs, sm, md, lg, xl, 2xl (default: md)
  • class: Custom CSS class, which can be used to change colors

Custom shortcodes

Add your shortcode templates in the ~/layout/_shortcodes directory. If using Tailwind CSS, you’ll need to compile styles locally to apply them to the theme.

Copyright Notice

Author: Hugo Narrow

Link: https://hugo-narrow-docs.vercel.app/docs/extended-shortcodes/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut