diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json new file mode 100644 index 00000000..84052845 --- /dev/null +++ b/.codesandbox/ci.json @@ -0,0 +1,4 @@ +{ + "sandboxes": ["2d17z"], + "packages": [".", "packages/docsify-server-renderer"] +} diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 00000000..e7f5bb59 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,4 @@ +titleAndCommits: true +allowMergeCommits: true +allowRevertCommits: true +anyCommit: true diff --git a/cypress/fixtures/tpl/docs.index.html b/cypress/fixtures/tpl/docs.index.html index 94d9526e..6a8b41a4 100644 --- a/cypress/fixtures/tpl/docs.index.html +++ b/cypress/fixtures/tpl/docs.index.html @@ -16,7 +16,7 @@ diff --git a/docs/_media/example-with-yaml.md b/docs/_media/example-with-yaml.md new file mode 100644 index 00000000..081bedde --- /dev/null +++ b/docs/_media/example-with-yaml.md @@ -0,0 +1,6 @@ +--- +author: John Smith +date: 2020-1-1 +--- + +> This is from the `example.md` diff --git a/docs/configuration.md b/docs/configuration.md index 11797c79..69735ae1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -144,6 +144,16 @@ window.$docsify = { }; ``` +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: + +```markdown +- Sidebar + - [Home](/) + - [Another page](another.md) +``` + +For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131). + ## basePath - Type: `String` @@ -265,7 +275,7 @@ window.$docsify = { - Type: `String` - Default: `window.location.pathname` -The name of the link. +The URL that the website `name` links to. ```js window.$docsify = { @@ -446,11 +456,11 @@ window.$docsify = { - type: `String` - default: `noopener` -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'`. +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. ```js window.$docsify = { - externalLinkTarget: '', // default: 'noopener' + externalLinkRel: '', // default: 'noopener' }; ``` @@ -587,4 +597,4 @@ Adds a space on top when scrolling content page to reach the selected section. T window.$docsify = { topMargin: 90, // default: 0 }; -``` \ No newline at end of file +``` diff --git a/docs/embed-files.md b/docs/embed-files.md index dab2efe4..d5038747 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -39,7 +39,20 @@ You will get it [filename](_media/example.md ':include :type=code') +## Markdown with YAML Front Matter + +When using Markdown, YAML front matter will be stripped from the rendered content. The attributes cannot be used in this case. + +```markdown +[filename](_media/example-with-yaml.md ':include') +``` + +You will get just the content + +[filename](_media/example-with-yaml.md ':include') + ## Embedded code fragments + 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. ```markdown @@ -53,7 +66,6 @@ Example: [filename](_media/example.js ':include :type=code :fragment=demo') - ## Tag attribute If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags. diff --git a/docs/helpers.md b/docs/helpers.md index 83c59784..9cb511f9 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -65,6 +65,14 @@ You will get `link`html. Do not worry, you can still set ti [link](/demo ':disabled') ``` +## Cross-Origin link + +Only when you both set the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need add this configuration for those Cross-Origin links. + +```md +[example.com](https://example.com/ ':crossorgin') +``` + ## Github Task Lists ```md diff --git a/docs/index.html b/docs/index.html index 39c32b81..050b21dd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,14 +9,14 @@ - + - + - +