GOLB 短代码示例
目录
注:使用前检查文章是否需要手动摘要
<!--more-->
code.html
<!--more-->
{{< code language="" title="" isCollapsed="true" option="hl_Lines=NUMBER,wrapperClass=CLASSNAME" >}}
CODE
{{< /code >}}
hl.html
go-html-template
{{< hl LANGUAGE >}}CODE{{< /hl >}}html.html(弃用)
go-html-template
{{< html >}}
HTML
{{< /html >}}math.html(行内数学公式)
go-html-template
{{< math >}}LATEX{{< /math >}}字符强调
<·字符·>
don't use \(字符\)
hide.html
go-html-template
{{< hide >}}
需要HTML注释的内容
{{< /hide >}}Can also use <!-- Content -->.
ref.html
go-html-template
{{< ref mode="res" />}}
这是一段文本,用于测试{{< ref "1" "~~我是 1~~. *不*,**你**才 \"about\" 是 1." />}}。
这是一段文本,用于测试{{< ref "2" "<del>我是 2</del>." />}}。
{{< ref mode="res" />}}
这是一段文本,用于测试{{< ref "3" "<del>我是 3</del>." >}}{{< /ref >}} {{< ref "1" />}}。
这是一段文本,用于测试{{< ref "4" "<del>我是 4</del>." >}}{{< /ref >}}。
{{< ref mode="res" >}}{{< /ref >}}
{{< ref mode="res" />}}示例:
说明:
{{< ref mode="default | res" "KEY" "VALUE" />}}:首次添加引用最好必须同时包含 "KEY" "VALUE" 两个参数(不修改 mode 参数),之后可仅包含第一个 "KEY" 参数进行重复引用(否则可能出问题),同一个 "KEY" 参数不会有超过 1 个 "VALUE" 参数;在添加了引用时,必须同时在{{< ref mode="res" />}};参数值若要输入引号,请使用转义(\")、单引号(')或者其他支持的引号。这也是常规的用法,一般只要使用符合逻辑不会出现问题。
特性:
- 支持 markdown 格式的参数渲染
- 自适应的脚注显示范围,保证每条引用只出现一次,没有脚注可以显示时自动销毁
- 灵活转换复用引用跳转的锚点
- 可与其他元素进行灵活的嵌套
col.html
go-html-template
{{< col "**不折**叠 1" any >}}
- 你好吗
- 不
一段用于测试的话。
{{< /col >}}
{{< col "折叠 2" >}}
- 你好吗
- 不
{{< /col >}}示例:
不折叠 1
- 你好吗
- 不
一段用于测试的话。
折叠 2
- 你好吗
- 不
嵌套示例
咳
别开了
放弃吧
真的
里面什么都有。
说明:不支持外层 Markdown 嵌套。
开发日志(心路历程)
rt.html
{{< rt >}}一段用于测试的话。{{< /rt >}}
示例:
一段用于测试的话。说明:不能用于 flex 布局(如 col.html)等。
图片转 base64
这不是短代码,顺便记的
base64 -w 0 /path/to/image.jpg > /path/to/base64.txt
data:image/png;base64,数据
png, jpeg
- Total words: 1102 -
Read other posts