Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
c9d5e81c
Y
yanglr2010
项目概览
大白技术控
/
yanglr2010
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yanglr2010
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c9d5e81c
编写于
8月 02, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: Add tag plugin of 'note'
上级
1d86188a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
113 addition
and
0 deletion
+113
-0
docs/zh-CN/advanced/assist.md
docs/zh-CN/advanced/assist.md
+34
-0
scripts/tags/note.js
scripts/tags/note.js
+14
-0
source/css/_components/index.styl
source/css/_components/index.styl
+1
-0
source/css/_components/tag-plugin/index.styl
source/css/_components/tag-plugin/index.styl
+1
-0
source/css/_components/tag-plugin/note.styl
source/css/_components/tag-plugin/note.styl
+63
-0
未找到文件。
docs/zh-CN/advanced/assist.md
浏览文件 @
c9d5e81c
...
...
@@ -86,3 +86,37 @@ Hexo 主题一般都会扩展一些自己特有的标签插件,在这方面做
3.
重启 Hexo 服务器,效果如下。
![](
https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190802171506.png
)
### Bootstrap 标注 <Badge text="stable"/> <Badge text="v1.2.0"/>
语法如下:
```
{% note [type] [no-icon] %}
**header text**
any text
{% endnote %}
```
> 标签内可以是任意文字,支持 markdown 和 HTML 语法。
参数:
`[type]`
:标注类型
`[no-icon]`
:是否显示 ICON
举例:
```
{% note success %}
**Success**
This is success note.
{% endnote %}
```
全部效果如下:
![](
https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190802221712.png
)
scripts/tags/note.js
0 → 100644
浏览文件 @
c9d5e81c
/* global hexo */
'
use strict
'
;
function
note
(
args
,
content
)
{
return
`<div class="note-plugin
${
args
.
join
(
'
'
)}
">
${
hexo
.
render
.
renderSync
({
text
:
content
,
engine
:
'
markdown
'
})
.
split
(
'
\n
'
)
.
join
(
''
)}
</div>`
;
}
hexo
.
extend
.
tag
.
register
(
'
note
'
,
note
,
{
ends
:
true
});
source/css/_components/index.styl
浏览文件 @
c9d5e81c
...
...
@@ -11,3 +11,4 @@
@import './copy.styl'
@import './analytics/index.styl'
@import './search/index.styl'
@import './tag-plugin/index.styl'
source/css/_components/tag-plugin/index.styl
0 → 100644
浏览文件 @
c9d5e81c
@import './note.styl'
source/css/_components/tag-plugin/note.styl
0 → 100644
浏览文件 @
c9d5e81c
.note-plugin
position: relative
margin: 1rem 0
border: 1px solid #eee
border-left-width: .35rem
padding: 0 1rem
line-height: 1.7em
&:not(.no-icon)
padding-left: 2rem
&::before
position: absolute
top: .8em
left: .6rem
font-family: 'FontAwesome'
font-size: $font-size-base + 6px
&.default::before
content: '\f0a9'
color: #777
&.success::before
content: '\f058'
color: #5cb85c
&.warning::before
content: '\f06a'
color: #f0ad4e
&.danger::before
content: '\f056'
color: #d9534f
&.default
border-left-color: #777
strong
color: #777
&.success
border-left-color: #5cb85c
strong
color: #5cb85c
&.warning
border-left-color: #f0ad4e
strong
color: #f0ad4e
&.danger
border-left-color: #d9534f
strong
color: #d9534f
h1, h2, h3, h4, h5, h6
margin: 0
strong
font-size: $font-size-base + 6px
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录