diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bb31bd41f..2d5b3e545 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,6 +14,7 @@ - [ ] Refactor - [ ] Docs - [ ] Build-related changes +- [ ] Repo settings - [ ] Other, please describe: If changing the UI of default theme, please provide the **before/after** screenshot: @@ -44,11 +45,3 @@ If adding a **new feature**, the PR's description includes: - [ ] Related tests have been updated To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it. - - -**Other information:** - ---- - -* [ ] DO NOT include files inside `lib` directory. - diff --git a/.gitignore b/.gitignore index e9803a96f..dc015fd2a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,10 @@ .DS_Store .idea node_modules -themes/ -lib/ -cypress/integration/examples -cypress/fixtures/docs +/themes/ +/lib/ +/cypress/integration/examples +/cypress/fixtures/docs # exceptions -!.gitkeep \ No newline at end of file +!.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index 784dec697..facd1fe95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +## [4.11.5](https://github.com/docsifyjs/docsify/compare/v4.11.4...v4.11.5) (2020-08-21) + + +### Bug Fixes + +* Russian language link error ([#1270](https://github.com/docsifyjs/docsify/issues/1270)) ([2a52460](https://github.com/docsifyjs/docsify/commit/2a52460a59448abaf681046fbc5dca642285ae1f)) +* {docsify-updated} in the sample code is parsed into time ([#1321](https://github.com/docsifyjs/docsify/issues/1321)) ([2048610](https://github.com/docsifyjs/docsify/commit/2048610aacd4e3c6a592f4247834a726c7ca33fb)) +* Add error handling for missing dependencies (fixes [#1210](https://github.com/docsifyjs/docsify/issues/1210)) ([#1232](https://github.com/docsifyjs/docsify/issues/1232)) ([3673001](https://github.com/docsifyjs/docsify/commit/3673001a24cb24c57454f9bc7619de49d2c3a044)) +* after setting the background image, the button is obscured ([#1234](https://github.com/docsifyjs/docsify/issues/1234)) ([34d918f](https://github.com/docsifyjs/docsify/commit/34d918f9973bdb8e893248853e3ef7e803d4c253)) +* convert {docsify-ignore} and {docsify-ignore-all} to HTML comments ([#1318](https://github.com/docsifyjs/docsify/issues/1318)) ([90d283d](https://github.com/docsifyjs/docsify/commit/90d283d340502456a5d8495df596bb4a02ceb39b)) +* fallback page should use path not file location ([#1301](https://github.com/docsifyjs/docsify/issues/1301)) ([2bceabc](https://github.com/docsifyjs/docsify/commit/2bceabcb8e623570540493e2f1d956adf45c99e7)) +* Fix search error when exist translations documents ([#1300](https://github.com/docsifyjs/docsify/issues/1300)) ([b869019](https://github.com/docsifyjs/docsify/commit/b8690199006366e86084e9e018def7b9b8f46512)) +* gitignore was ignoring folders in src, so VS Code search results or file fuzzy finder were not working, etc ([d4c9247](https://github.com/docsifyjs/docsify/commit/d4c9247b87c0a2701683ed1a17383cfb451cf609)) +* packages/docsify-server-renderer/package.json & packages/docsify-server-renderer/package-lock.json to reduce vulnerabilities ([#1250](https://github.com/docsifyjs/docsify/issues/1250)) ([d439bac](https://github.com/docsifyjs/docsify/commit/d439bac93f479d0480799880538fc3104e54c907)) +* search can not search the table header ([#1256](https://github.com/docsifyjs/docsify/issues/1256)) ([3f03e78](https://github.com/docsifyjs/docsify/commit/3f03e78418993d8e9a4f5062e10dc79c3753389e)) +* Search plugin: matched text is replaced with search text ([#1298](https://github.com/docsifyjs/docsify/issues/1298)) ([78775b6](https://github.com/docsifyjs/docsify/commit/78775b6ee73102cc5ac71c0ee2b392c5f4f6f4f8)) +* the uncaught typeerror when el is null ([#1308](https://github.com/docsifyjs/docsify/issues/1308)) ([952f4c9](https://github.com/docsifyjs/docsify/commit/952f4c921b7a6a558c500ca6b105582d39ad36a2)) +* Updated docs with instructions for installing specific version (fixes [#780](https://github.com/docsifyjs/docsify/issues/780)) ([#1225](https://github.com/docsifyjs/docsify/issues/1225)) ([b90c948](https://github.com/docsifyjs/docsify/commit/b90c948090e89fa778279c95060dbd7668285658)) +* upgrade medium-zoom from 1.0.5 to 1.0.6 ([3beaa66](https://github.com/docsifyjs/docsify/commit/3beaa6666b78518f1ffaa37f6942f3cb08fef896)) +* upgrade tinydate from 1.2.0 to 1.3.0 ([#1341](https://github.com/docsifyjs/docsify/issues/1341)) ([59d090f](https://github.com/docsifyjs/docsify/commit/59d090fe9096bc03e259c166634bb75bb2623f85)) + + +### Features + +* **search:** add pathNamespaces option ([d179dde](https://github.com/docsifyjs/docsify/commit/d179dde1c71acdcbe66cb762377b123926c55bf2)) +* Add title to sidebar links ([#1286](https://github.com/docsifyjs/docsify/issues/1286)) ([667496b](https://github.com/docsifyjs/docsify/commit/667496b85d99b168255f58e60a6bfe902cc6ee03)) + + + ## [4.11.4](https://github.com/docsifyjs/docsify/compare/v4.11.3...v4.11.4) (2020-06-18) diff --git a/README.md b/README.md index bdd2fa558..0d44dec32 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
diff --git a/build/build.js b/build/build.js index 563861373..0de786828 100644 --- a/build/build.js +++ b/build/build.js @@ -22,7 +22,10 @@ async function build(opts) { .rollup({ input: opts.input, plugins: (opts.plugins || []).concat([ - buble(), + buble({ + transforms: { + dangerousForOf: true + }}), commonjs(), nodeResolve(), replace({ @@ -33,8 +36,8 @@ async function build(opts) { onwarn: function (message) { if (message.code === 'UNRESOLVED_IMPORT') { throw new Error( - `Could not resolve module ` + - message.source + + `Could not resolve module ` + + message.source + `. Try running 'npm install' or using rollup's 'external' option if this is an external dependency. ` + `Module ${message.source} is imported in ${message.importer}` ) diff --git a/cypress/fixtures/tpl/docs.index.html b/cypress/fixtures/tpl/docs.index.html index a4b4c831f..3ffe35230 100644 --- a/cypress/fixtures/tpl/docs.index.html +++ b/cypress/fixtures/tpl/docs.index.html @@ -28,7 +28,7 @@ alias: { '.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md', - '.*?/changelog': + '/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md', '/.*/_navbar.md': '/_navbar.md', '/zh-cn/(.*)': @@ -40,6 +40,7 @@ '/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1' }, + fallbackLanguages: ['es'], auto2top: true, coverpage: true, executeScript: true, diff --git a/cypress/integration/routing/fallback.spec.js b/cypress/integration/routing/fallback.spec.js new file mode 100644 index 000000000..2e9951102 --- /dev/null +++ b/cypress/integration/routing/fallback.spec.js @@ -0,0 +1,9 @@ +context('config.fallbackLanguages', () => { + it('fallbacks respecting aliases', () => { + cy.visit('http://localhost:3000/#/es/'); + + cy.get('.sidebar-nav').contains('Changelog').click(); + + cy.get('#main').should('contain', 'Bug Fixes'); + }) +}); diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 07c318651..51db8d2e9 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@  -# docsify 4.11.4 +# docsify 4.11.5 > A magical documentation site generator. diff --git a/docs/cdn.md b/docs/cdn.md index 82b2d2d90..05fff3c28 100644 --- a/docs/cdn.md +++ b/docs/cdn.md @@ -44,7 +44,7 @@ Alternatively, use [compressed files](#compressed-file). ## Other CDN -- http://www.bootcdn.cn/docsify +- https://www.bootcdn.cn/docsify/ - https://cdn.jsdelivr.net/npm/docsify/ - https://cdnjs.com/libraries/docsify - +- https://unpkg.com/browse/docsify/ diff --git a/docs/configuration.md b/docs/configuration.md index 371ed35f6..1b2d04878 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -12,7 +12,7 @@ You can configure Docsify by defining `window.$docsify` as an object: ``` -The config can also be defined as a function, in which case the first arg is the Docsify `vm` instance. The function should return a config object. This can be useful for referencing `vm` in places like the markdown configuration: +The config can also be defined as a function, in which case the first argument is the Docsify `vm` instance. The function should return a config object. This can be useful for referencing `vm` in places like the markdown configuration: ```html @@ -33,7 +37,8 @@ '/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1', '/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1', '/ru-ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1', - '/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1' + '/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1', + '/write-a-plugin': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/docs/write-a-plugin.md' }, auto2top: true, coverpage: true, @@ -62,8 +67,8 @@ '/': 'Search' } }, - formatUpdated: '{MM}/{DD} {HH}:{mm}', plugins: [ + DocsifyCarbon.create('CEBI6KQE', 'docsifyjsorg'), function (hook, vm) { hook.beforeEach(function (html) { if (/githubusercontent\.com/.test(vm.route.file)) { diff --git a/docs/more-pages.md b/docs/more-pages.md index 429eaf97a..0f9386848 100644 --- a/docs/more-pages.md +++ b/docs/more-pages.md @@ -114,24 +114,24 @@ A custom sidebar can also automatically generate a table of contents by setting ## Ignoring Subheaders -When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it. +When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `` to it. ```markdown # Getting Started -## Header {docsify-ignore} +## Header This header won't appear in the sidebar table of contents. ``` -To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page. +To ignore all headers on a specific page, you can use `` on the first header of the page. ```markdown -# Getting Started {docsify-ignore-all} +# Getting Started ## Header This header won't appear in the sidebar table of contents. ``` -Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used. +Both `` and `` will not be rendered on the page when used. diff --git a/docs/plugins.md b/docs/plugins.md index 51acefbb5..feca8b551 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -44,6 +44,17 @@ By default, the hyperlink on the current page is recognized and the content is s // To avoid search index collision // between multiple websites under the same domain namespace: 'website-1', + + // Use different indexes for path prefixes (namespaces). + // NOTE: Only works in 'auto' mode. + // + // When initialiazing an index, we look for the first path from the sidebar. + // If it matches the prefix from the list, we switch to the corresponding index. + pathNamespaces: ['/zh-cn', '/ru-ru', '/ru-ru/v1'], + + // You can provide a regexp to match prefixes. In this case, + // the matching substring will be used to identify the index + pathNamespaces: /^(\/(zh-cn|ru-ru))?(\/(v1|v2))?/ } } diff --git a/index.html b/index.html index 5d2319844..8247ce5f5 100644 --- a/index.html +++ b/index.html @@ -9,10 +9,16 @@ + + @@ -27,7 +33,8 @@ '/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1', '/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1', '/ru-ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1', - '/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1' + '/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1', + '/write-a-plugin': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/docs/write-a-plugin.md' }, auto2top: true, basePath: '/docs/', @@ -50,10 +57,11 @@ '/de-de/': 'Suche', '/zh-cn/': '搜索', '/': 'Search' - } + }, + pathNamespaces: ['/zh-cn', '/de-de', '/ru-ru', '/es'] }, - formatUpdated: '{MM}/{DD} {HH}:{mm}', plugins: [ + DocsifyCarbon.create('CEBI6KQE', 'docsifyjsorg'), function (hook, vm) { hook.beforeEach(function (html) { if (/githubusercontent\.com/.test(vm.route.file)) { @@ -68,7 +76,6 @@ url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file } var editHtml = '[:memo: Edit Document](' + url + ')\n' - return editHtml + html + '\n\n----\n\n' @@ -82,9 +89,10 @@ - - - + + + +