扩展 Shortcode - Admonition

目录

admonition shortcode 允许你在内容中添加各种类型的标注。

技巧

这是 FixIt 主题提供的扩展 shortcode。
为了更好的跨平台兼容性,推荐使用 Alert Markdown 扩展语法

参数配置

admonition shortcode 有以下具名参数,位置参数按照从上到下的顺序排列:

参数说明类型默认值
typeadmonition 横幅的类型。见 支持的类型stringnote
titleadmonition 横幅的标题。(支持 Markdown 和 HTML 格式)stringtype 参数值
open横幅内容是否默认展开。booleantrue

基础用法

一个 admonition 示例:

1
2
3
4
5
6
7
{{< admonition type=quote title="[FixIt](https://github.com/hugo-fixit/FixIt)" open=true >}}
一个**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
{{< /admonition >}}
或者
{{< admonition quote "[FixIt](https://github.com/hugo-fixit/FixIt)" true >}}
一个**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
{{< /admonition >}}

呈现的输出效果如下:

一个简洁优雅高效Hugo 博客主题。

支持的类型

admonition shortcode 支持 13 种类型的横幅,除非你 自定义 Admonition,否则任何不支持的类型都会默认为 note 类型。类型标识不区分大小写。

完整示例如下:

注意
{{< admonition >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}
摘要
{{< admonition abstract >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:summary, tldr

信息
{{< admonition info >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}
待办

FixIt 0.3.13 | 新增

{{< admonition todo >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}
技巧
{{< admonition tip >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:hint, important

成功
{{< admonition success >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:check, done

问题
{{< admonition question >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:help, faq

警告
{{< admonition warning >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:caution, attention

失败
{{< admonition failure >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

别名:fail, missing

危险
{{< admonition danger >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

Alias: error

Bug
{{< admonition bug >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}
示例
{{< admonition example >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}
引用
{{< admonition quote >}}
The quick brown fox jumps over the lazy dog.
{{< /admonition >}}

Alias: cite


相关内容

Buy me a coffee
Lruihao 支付宝支付宝
Lruihao 微信微信

发现新版本

当前站点有新版本可用。