Skip to content

Commit 809fda9

Browse files
authored
Merge branch 'develop' into allow-config-function
2 parents 63f1b88 + 7853026 commit 809fda9

File tree

28 files changed

+2116
-1639
lines changed

28 files changed

+2116
-1639
lines changed

.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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ window.$docsify = {
162162
};
163163
```
164164

165+
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:
166+
167+
```markdown
168+
- Sidebar
169+
- [Home](/)
170+
- [Another page](another.md)
171+
```
172+
173+
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
174+
165175
## basePath
166176

167177
- Type: `String`
@@ -464,11 +474,11 @@ window.$docsify = {
464474
- type: `String`
465475
- default: `noopener`
466476

467-
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'`.
477+
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.
468478

469479
```js
470480
window.$docsify = {
471-
externalLinkTarget: '', // default: 'noopener'
481+
externalLinkRel: '', // default: 'noopener'
472482
};
473483
```
474484

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: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
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">
13-
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" title="vue">
12+
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
14+
<link
15+
rel="stylesheet"
16+
href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/docsify-style.min.css"
17+
title="docsify-darklight-theme"
18+
type="text/css"
19+
/>
20+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" title="vue" disabled>
1421
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" title="dark" disabled>
1522
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" title="buble" disabled>
1623
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" title="pure" disabled>
17-
24+
1825
<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"/>
2026
<style>
2127
nav.app-nav li ul {
2228
min-width: 100px;
@@ -32,7 +38,7 @@
3238
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
3339
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
3440
'/.*/_navbar.md': '/_navbar.md',
35-
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
41+
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
3642
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
3743
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
3844
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
@@ -64,10 +70,8 @@
6470
'/': 'Search'
6571
}
6672
},
67-
darkMode: {
68-
light: {
69-
toggleBtnBg: '#42b983'
70-
}
73+
darklightTheme: {
74+
bodyFontSize : '15px',
7175
},
7276
formatUpdated: '{MM}/{DD} {HH}:{mm}',
7377
plugins: [
@@ -77,6 +81,10 @@
7781
url = vm.route.file
7882
.replace('raw.githubusercontent.com', 'github.com')
7983
.replace(/\/master/, '/blob/master')
84+
} else if (/jsdelivr\.net/.test(vm.route.file)) {
85+
url = vm.route.file
86+
.replace('cdn.jsdelivr.net/gh', 'github.com')
87+
.replace('@master', '/blob/master')
8088
} else {
8189
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
8290
}
@@ -99,7 +107,10 @@
99107
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
100108
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
101109
<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>
110+
<script
111+
src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/index.min.js"
112+
type="text/javascript">
113+
</script>
103114
<script>
104115
((window.gitter = {}).chat = {}).options = {
105116
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>

packages/docsify-server-renderer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ renderer.renderToString(url)
3434
<head>
3535
<meta charset="UTF-8">
3636
<title>docsify</title>
37-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
37+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
3838
<link rel="stylesheet" href="//unpkg.com/docsify/themes/buble.css" title="buble" disabled>
3939
</head>
4040
<body>

0 commit comments

Comments
 (0)