Custom shortcode example

Summary
Set commonly used block references, label cards, buttons, and other information as short codes for quick referencing

Although the Markdown syntax is already very rich and can meet the vast majority of our writing needs, in order to better layout the content of the article in a more friendly way, a set of custom phrases has been designed for citation, which can be quickly referenced when used.

Block reference

When quoting some classic quotes, this phrase can be used. The grammar reference is as follows:

1
2
3
4
5
6
{{< quote >}}

###  block quote

Write down the words you want to express!
{{< /quote >}}

Actual effect:

Hope is indifferent to existence, indifferent to nothingness, just like the road on earth.

In fact, there is no road on the ground, and with more people walking, it becomes a road.

Lu Xun

Information Block

Support ‘default’` The presentation of five different effects, including info, success, warning, and danger, with the following syntax reference:

1
2
3
4
{{< note [class] [no-icon] >}}
Write and express information
Support Markdown syntax
{{< /note >}}

Actual effect:

Default Header without icon

Welcome to Hugo NexT!

Default Header

Welcome to Hugo NexT!

Primary Header

Welcome to Hugo NexT!

Info Header

Welcome to Hugo NexT!

Success Header

Welcome to Hugo NexT!

Warning Header

Welcome to Hugo NexT!

Danger Header

Welcome to Hugo NexT!

Bilibili video

1
2
3
{{< bilibili BV1Sx411T7QQ >}}
perhaps
{{< bilibili id=BV1Sx411T7QQ >}}

Music player

Based on Player And MatingJS The library implements a responsive music player embedded in the meeting, with automatically recognized music platform URLs, including:` Netease, Tencent, Kugou, Baidu, and Xiami platforms also support user-defined music sources. Other relevant parameter explanations are as follows:

Parameter NameDefaultDescription
idRequiredMusic ID, which is the unique identifier of the music on the music platform
serverRequiredMusic platform, supports neteasetencentkugoubaidu and xiami
typeRequiredPlay type, currently supports songplaylistalbumsearch and artist
autoOptionalMusic address, only supports the platform in the server parameter
theme#448affThe theme color of the player defaults to #448aff
urlEmptyCustom music source URL, default to empty
nameEmptyMusic name, default to empty
artistEmptyMusic author, default to empty
coverEmptyMusic cover URL, default to empty
fixedfalseFixed player, default to false
minifalseDisplay mini player, default to false
autoplayfalseAutoplay the music, default to false
loopallLoop playback, supports allone and none,default to all
orderlistPlay order list and random,default to list
volume0.7Volume, default is 0.7
mutextrueWhen multiple pieces of music are playing, should only the current player be turned on,default to true
list-foldedfalseList collapse, default is false
list-max-height340pxThe maximum height of the list is 340px by default

Single playback

1
{{< music theme="#2980b9" server="tencent" type="song" id="002u4ZTb0CXmJA" mini="true" >}}

List playback

1
{{< music server="netease" type="playlist" id="1982066521" list-max-height="140" >}}

Customize music source

1
{{< music url="/music/sky.mp3" name="Sky City" artist="Hayao Miyazaki" cover="/music/gongqijun.jpg" autoplay="true" >}}