Skip to content

Commit

Permalink
Merge branch 'develop' into snyk-fix-3ec1f5a2835b0c7ec854adb3461e3a96
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Aug 13, 2020
2 parents cf80416 + f7be0b0 commit e58992f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion cypress/fixtures/tpl/docs.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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/(.*)':
Expand All @@ -40,6 +40,7 @@
'/es/(.*)':
'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
},
fallbackLanguages: ['es'],
auto2top: true,
coverpage: true,
executeScript: true,
Expand Down
9 changes: 9 additions & 0 deletions cypress/integration/routing/fallback.spec.js
Original file line number Diff line number Diff line change
@@ -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');
})
});
4 changes: 2 additions & 2 deletions docs/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/docsify-server-renderer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/core/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function fetchMixin(proto) {
this._loadSideAndNav(path, qs, loadSidebar, cb)
),
_ => {
this._fetchFallbackPage(file, qs, cb) || this._fetch404(file, qs, cb);
this._fetchFallbackPage(path, qs, cb) || this._fetch404(file, qs, cb);
}
);

Expand Down Expand Up @@ -209,7 +209,9 @@ export function fetchMixin(proto) {
return false;
}

const newPath = path.replace(new RegExp(`^/${local}`), '');
const newPath = this.router.getFile(
path.replace(new RegExp(`^/${local}`), '')
);
const req = request(newPath + qs, true, requestHeaders);

req.then(
Expand Down

0 comments on commit e58992f

Please sign in to comment.