Theme Documentation - Extended Shortcodes

LoveIt theme provides multiple shortcodes on top of built-in ones in Hugo.
1 style
style shortcode, because the style content is compiled with it. The extended edition of Hugo alone is not enough, see Theme Documentation - Basics.style is a shortcode to insert custom style in your post.
The style shortcode has two positional parameters.
The first one is the custom style content,
which supports nesting syntax in SASS
and & referring to this parent HTML element.
And the second one is the tag name of the HTML element wrapping the content you want to change style, and whose default value is div.
Example style input:
{{< style "text-align:right; strong{color:#00b1ff;}" >}}
This is a **right-aligned** paragraph.
{{< /style >}}The rendered output looks like this:
2 link
link shortcode is an alternative to Markdown link syntax. link shortcode can provide some other features and can be used in code blocks.
The link shortcode has the following named parameters:
href [required] (first positional parameter)
Destination of the link.
content [optional] (second positional parameter)
Content of the link. When using positional parameters, default value is the value of href parameter. When using named parameters, there is no default value: if
contentis omitted, the link is rendered as an emptyatag, so always setcontent=explicitly.Markdown or HTML format is supported.
title [optional] (third positional parameter)
titleattribute of the HTMLatag, which will be shown when hovering on the link.class [optional]
classattribute of the HTMLatag.rel [optional]
Additional
relattributes of the HTMLatag.
Example link input:
{{< link "https://assemble.io" >}}
Or
{{< link href="https://assemble.io" content="https://assemble.io" >}}
{{< link "mailto:contact@revolunet.com" >}}
Or
{{< link href="mailto:contact@revolunet.com" content="mailto:contact@revolunet.com" >}}
{{< link "https://assemble.io" Assemble >}}
Or
{{< link href="https://assemble.io" content=Assemble >}}The rendered output looks like this:
Example link input with a title:
{{< link "https://github.com/upstage/" Upstage "Visit Upstage!" >}}
Or
{{< link href="https://github.com/upstage/" content=Upstage title="Visit Upstage!" >}}The rendered output looks like this (hover over the link, there should be a tooltip):
Upstage3 image
image shortcode is an alternative to figure shortcode. image shortcode uses Hugo’s image processing and native lazy loading, and can take full advantage of lightGallery.
The image shortcode has the following named parameters:
src [required] (first positional parameter)
URL of the image to be displayed.
alt [optional] (second positional parameter)
Alternate text for the image if the image cannot be displayed, default value is the value of src parameter.
Markdown or HTML format is supported.
caption [optional] (third positional parameter)
Image caption.
Markdown or HTML format is supported.
title [optional]
Image title that will be shown when hovering on the image.
class [optional]
classattribute of the HTMLfiguretag. Named parameter only, and it takes effect only when caption is set, because thefiguretag is only rendered with a caption.src_s [optional]
URL of the image thumbnail, used for lightgallery, default value is the smallest WebP copy of a processed image, otherwise the value of src parameter.
src_l [optional]
URL of the HD image, used for lightgallery, default value is the value of src parameter.
height [optional]
heightattribute of the image.When only one of width and height is a number of pixels, the other one follows the aspect ratio of the image when Hugo can read its size.
width [optional]
widthattribute of the image. By default, the size of an image in the page bundle or in assets (not SVG).linked [optional]
Whether the image needs to be hyperlinked. With named parameters, default value is
true. With positional parameters, the image is hyperlinked only when a caption is given (use named parameters to control it explicitly).rel [optional]
Additional
relattributes of the HTMLatag, if linked parameter is set totrue.
Example image input:
{{< image src="/images/lighthouse.jpg" caption="Lighthouse (`image`)" src_s="/images/lighthouse-small.jpg" src_l="/images/lighthouse-large.jpg" >}}The rendered output looks like this:

image)4 admonition
The admonition shortcode supports 13 types of admonition banners to help you put notice in your page.
Markdown or HTML format in the content is supported.
Aliases: summary, tldr
An abstract banner
Aliases: hint, important
A tip banner
Aliases: check, done
A success banner
Aliases: help, faq
A question banner
Aliases: warn, caution, attention
A warning banner
Aliases: fail, missing
A failure banner
Aliases: error
A danger banner
Aliases: cite
A quote banner
The admonition shortcode has the following named parameters:
type [optional] (first positional parameter)
Type of the
admonitionbanner, default value isnote.title [optional] (second positional parameter)
Title of the
admonitionbanner, default value is the value of type parameter.open [optional] (third positional parameter)
Whether the content will be expandable by default, default value is
true.
Example admonition input:
{{< admonition type=tip title="This is a tip" open=false >}}
This is a tip
{{< /admonition >}}
Or
{{< admonition tip "This is a tip" false >}}
This is a tip
{{< /admonition >}}The rendered output looks like this:
5 mermaid
The mermaid shortcode supports diagrams in Hugo with the Mermaid syntax, rendered by Pele or the Mermaid library.
The full documentation is provided in Theme Documentation - mermaid Shortcode.
6 echarts
The echarts shortcode supports data visualization in Hugo with ECharts library.
The full documentation is provided in Theme Documentation - echarts Shortcode.
7 mapbox
The mapbox shortcode supports interactive maps in Hugo with Mapbox GL JS library.
The full documentation is provided in Theme Documentation - mapbox Shortcode.
8 music
The music shortcode embeds a responsive music player based on APlayer and MetingJS library.
The full documentation is provided in Theme Documentation - music Shortcode.
9 bilibili
The bilibili shortcode embeds a responsive video player for bilibili videos.
The full documentation is provided in Theme Documentation - bilibili Shortcode.
10 typeit
The typeit shortcode provides typing animation based on TypeIt library.
The full documentation is provided in Theme Documentation - typeit Shortcode.
11 script
script is a shortcode to insert custom Javascript in your post.
Example script input:
{{< script >}}
console.log('Hello LoveIt!');
{{< /script >}}You can see the output in the console of the developer tool.
12 raw
raw is a shortcode to insert raw HTML content in your post.
This is useful when you want to include some Markdown content to avoid being rendered or escaped by Hugo.
Example raw input:
Inline Formula: {{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{< /raw >}}
Block Formula:
{{< raw >}}
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
Raw content using Markdown syntax: {{< raw >}}**Hello**{{< /raw >}}The rendered output looks like this:
Inline Formula:
Block Formula:
Raw content using Markdown syntax:
13 person
person is a shortcode to insert a link to a personal webpage marked up as h-card.
The person shortcode has the following named parameters:
url [required] (first positional parameter)
URL of the personal page.
name [required] (second positional parameter)
Name of the person.
text [optional] (third positional parameter)
Text to display as hover tooltip of the link.
picture [optional] (fourth positional parameter)
A picture to use as person’s avatar.
nick [optional]
Nickname of the person (named parameter only).
Example person input:
{{< person url="https://evgenykuznetsov.org" name="Evgeny Kuznetsov" nick="nekr0z" text="author of this shortcode" picture="https://evgenykuznetsov.org/img/avatar.jpeg" >}}This renders as
Evgeny Kuznetsov (nekr0z).
Without an explicitly given picture, a generic icon is used. This input:
{{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}This renders as Dillon.