Skip to content

Instantly share code, notes, and snippets.

@YazidLee
Last active October 1, 2021 15:49
Show Gist options
  • Save YazidLee/cb75a8f713f2903d126fe981d309608f to your computer and use it in GitHub Desktop.
Save YazidLee/cb75a8f713f2903d126fe981d309608f to your computer and use it in GitHub Desktop.
[Hugo Shortcodes] 个人博客中常用shortcodes #blog #shortcodes

可收缩、展开的容器,type 可以取值为 note, abstract, info, tip, success, question, warning, failure, danger, bug, example, quote, open:

{{< admonition type=note  title="标题" open=true >}}
<!-- 这里是内容 -->
{{< /admonition >}}

第一个参数为 bvid,第二个参数为第几 p:

{{< bilibili BV1TJ411C7An 3 >}}

第一个参数可以不写,第二个参数为需要高亮的代码,第三个参数表示代码块从第几行其开始展示:

```java {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
// ... code
```

这里再介绍一个在 markdown 中写注释的方法:

[//]: # (这里是注释的内容)

其中,[] 中的内容可替换,如:

[哈哈]: # (这里是注释的内容)
[嘿嘿]: # (这里是注释的内容)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment