Skip to content

Commit f31953d

Browse files
committed
docs(cn): support global md config for attributes of external links (#358)
1 parent 20e5bd8 commit f31953d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docs/guide/markdown.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Outbound links automatically gets `target="_blank" rel="noopener noreferrer"`:
5353
- [vuejs.org](https://vuejs.org)
5454
- [VuePress on GitHub](https://github.com/vuejs/vuepress)
5555

56-
You can customize the attributes added to external links by setting `config.markdown.externalLinks`. See more [here](/config/#markdown-externalLinks).
56+
You can customize the attributes added to external links by setting [config.markdown.externalLinks](../config/#markdown-externallinks).
5757

5858
## Front Matter
5959

docs/zh/config/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ module.exports = {
133133

134134
[markdown-it-anchor](https://github.com/valeriangalliat/markdown-it-anchor) 的选项。
135135

136+
### markdown.externalLinks
137+
138+
- Type: `Object`
139+
- Default: `{ target: '_blank', rel: 'noopener noreferrer' }`
140+
141+
这个键值对将会作为特性被增加到是外部链接的 `<a>` 标签上,默认的选项将会在新窗口中打开一个该外部链接。
142+
136143
### markdown.toc
137144

138145
- 类型: `Object`

docs/zh/guide/markdown.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@
4848

4949
### 外部链接
5050

51-
外部的链接将会被自动地设置为 `target="_blank"`:
51+
外部的链接将会被自动地设置为 `target="_blank" rel="noopener noreferrer"`:
5252

5353
- [vuejs.org](https://vuejs.org)
5454
- [VuePress on GitHub](https://github.com/vuejs/vuepress)
5555

56+
你可以自定义通过配置 [config.markdown.externalLinks](../config/#markdown-externallinks) 来自定义外部链接的特性。
57+
5658
## Front Matter
5759

5860
VuePress 提供了对 [YAML front matter](https://jekyllrb.com/docs/frontmatter/) 开箱即用的支持:

0 commit comments

Comments
 (0)