# 短代码

短代码是 Facile 主题提供的一种特殊语法,通过短代码可以插入一些特殊样式的内容。

Facile 主题的短代码使用的是类似于 WordPress Shortcode 和 BBCode 风格的方括号语法。

常见的短代码类似:

[alert]提示框[/alert]

[alert type="info"]提示框[/alert]

其中的 type 是样式属性,内容包裹在两个方括号的中间,结尾的方括号会有一个 / 结尾符,类似于 HTML。

目前支持的短代码还不多,后续会增加更多。

# 提示框

下面是提示框的语法:

[alert type="primary"]Typecho博客主题primary[/alert]

[alert type="info"]Typecho博客主题info[/alert]

[alert type="success"]Typecho博客主题success[/alert]

[alert type="secondary"]Typecho博客主题success[/alert]

[alert type="danger"]Typecho博客主题danger[/alert]

[alert type="warning"]Typecho博客主题warning[/alert]

[alert type="dark"]Typecho博客主题dark[/alert]

效果如下:

facile提示框短代码

不加 type 属性默认使用 primary 样式。

# 链接按钮

链接按钮就是按钮样式的链接。

下面是链接按钮语法:

[button url="http://example.com" type="primary"]按钮primary[/button]

[button url="http://example.com" type="info"]按钮info[/button]

[button url="http://example.com" type="success"]按钮success[/button]

[button url="http://example.com" type="secondary"]按钮secondary[/button]

[button url="http://example.com" type="danger"]按钮danger[/button]

[button url="http://example.com" type="warning"]按钮warning[/button]

[button url="http://example.com" type="dark"]按钮dark[/button]

链接按钮样式如下:

Facile链接按钮短代码

url 里就是链接地址,不加 type 默认使用 primary 样式。