Skip to content

Commit 7f835b1

Browse files
Merge branch 'develop' into update-config
2 parents 96d5b19 + 26cb940 commit 7f835b1

File tree

34 files changed

+2122
-1655
lines changed

34 files changed

+2122
-1655
lines changed

.codesandbox/ci.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"sandboxes": ["2d17z"],
3+
"packages": [".", "packages/docsify-server-renderer"]
4+
}

.github/semantic.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
titleAndCommits: true
2+
allowMergeCommits: true
3+
allowRevertCommits: true
4+
anyCommit: true

cypress/fixtures/tpl/docs.index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<meta name="description" content="A magical documentation generator." />
1717
<meta
1818
name="viewport"
19-
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
19+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
2020
/>
2121
<link rel="stylesheet" href="lib/themes/vue.css" title="vue" />
2222
<link rel="stylesheet" href="lib/themes/dark.css" title="dark" disabled />

docs/_media/example-with-yaml.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
author: John Smith
3+
date: 2020-1-1
4+
---
5+
6+
> This is from the `example.md`

docs/configuration.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ window.$docsify = {
144144
};
145145
```
146146

147+
If you have a link to the homepage in the sidebar and want it to be shown as active when accessing the root url, make sure to update your sidebar accordingly:
148+
149+
```markdown
150+
- Sidebar
151+
- [Home](/)
152+
- [Another page](another.md)
153+
```
154+
155+
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
156+
147157
## basePath
148158

149159
- Type: `String`
@@ -265,7 +275,7 @@ window.$docsify = {
265275
- Type: `String`
266276
- Default: `window.location.pathname`
267277

268-
The name of the link.
278+
The URL that the website `name` links to.
269279

270280
```js
271281
window.$docsify = {
@@ -446,11 +456,11 @@ window.$docsify = {
446456
- type: `String`
447457
- default: `noopener`
448458

449-
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when its not `'_blank'`.
459+
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when its not `'_blank'`. See [this post](https://mathiasbynens.github.io/rel-noopener/) for more information about why you may want to use this option.
450460

451461
```js
452462
window.$docsify = {
453-
externalLinkTarget: '', // default: 'noopener'
463+
externalLinkRel: '', // default: 'noopener'
454464
};
455465
```
456466

@@ -587,4 +597,4 @@ Adds a space on top when scrolling content page to reach the selected section. T
587597
window.$docsify = {
588598
topMargin: 90, // default: 0
589599
};
590-
```
600+
```

docs/embed-files.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,20 @@ You will get it
3939

4040
[filename](_media/example.md ':include :type=code')
4141

42+
## Markdown with YAML Front Matter
43+
44+
When using Markdown, YAML front matter will be stripped from the rendered content. The attributes cannot be used in this case.
45+
46+
```markdown
47+
[filename](_media/example-with-yaml.md ':include')
48+
```
49+
50+
You will get just the content
51+
52+
[filename](_media/example-with-yaml.md ':include')
53+
4254
## Embedded code fragments
55+
4356
Sometimes you don't want to embed a whole file. Maybe because you need just a few lines but you want to compile and test the file in CI.
4457

4558
```markdown
@@ -53,7 +66,6 @@ Example:
5366

5467
[filename](_media/example.js ':include :type=code :fragment=demo')
5568

56-
5769
## Tag attribute
5870

5971
If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.

docs/helpers.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
6565
[link](/demo ':disabled')
6666
```
6767

68+
## Cross-Origin link
69+
70+
Only when you both set the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need add this configuration for those Cross-Origin links.
71+
72+
```md
73+
[example.com](https://example.com/ ':crossorgin')
74+
```
75+
6876
## Github Task Lists
6977

7078
```md

docs/index.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
1010
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
1111
<meta name="description" content="A magical documentation generator.">
12-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
12+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
1313
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" title="vue">
1414
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" title="dark" disabled>
1515
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" title="buble" disabled>
1616
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" title="pure" disabled>
17-
17+
1818
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-codefund/index.js"></script>
19-
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/style.css"/>
19+
2020
<style>
2121
nav.app-nav li ul {
2222
min-width: 100px;
@@ -32,7 +32,7 @@
3232
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
3333
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
3434
'/.*/_navbar.md': '/_navbar.md',
35-
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
35+
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
3636
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
3737
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
3838
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
@@ -64,11 +64,6 @@
6464
'/': 'Search'
6565
}
6666
},
67-
darkMode: {
68-
light: {
69-
toggleBtnBg: '#42b983'
70-
}
71-
},
7267
formatUpdated: '{MM}/{DD} {HH}:{mm}',
7368
plugins: [
7469
function (hook, vm) {
@@ -77,6 +72,10 @@
7772
url = vm.route.file
7873
.replace('raw.githubusercontent.com', 'github.com')
7974
.replace(/\/master/, '/blob/master')
75+
} else if (/jsdelivr\.net/.test(vm.route.file)) {
76+
url = vm.route.file
77+
.replace('cdn.jsdelivr.net/gh', 'github.com')
78+
.replace('@master', '/blob/master')
8079
} else {
8180
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
8281
}
@@ -99,7 +98,6 @@
9998
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
10099
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
101100
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
102-
<script src="https://cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/index.js"></script>
103101
<script>
104102
((window.gitter = {}).chat = {}).options = {
105103
room: 'docsifyjs/Lobby'

docs/ssr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You can provide a template for entire page's HTML. such as
6868
<head>
6969
<meta charset="UTF-8">
7070
<title>docsify</title>
71-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
71+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
7272
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css" title="vue">
7373
</head>
7474
<body>

index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
2525
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
2626
'/.*/_navbar.md': '/_navbar.md',
27-
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
27+
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
2828
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
2929
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
3030
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
@@ -60,6 +60,10 @@
6060
url = vm.route.file
6161
.replace('raw.githubusercontent.com', 'github.com')
6262
.replace(/\/master/, '/blob/master')
63+
} else if (/jsdelivr\.net/.test(vm.route.file)) {
64+
url = vm.route.file
65+
.replace('cdn.jsdelivr.net/gh', 'github.com')
66+
.replace('@master', '/blob/master')
6367
} else {
6468
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
6569
}
@@ -76,6 +80,8 @@
7680
</script>
7781
<script src="/lib/docsify.js"></script>
7882
<script src="/lib/plugins/search.js"></script>
83+
<script src="/lib/plugins/emoji.js"></script>
84+
<script src="/lib/plugins/front-matter.js"></script>
7985
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
8086
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
8187
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>

0 commit comments

Comments
 (0)