Skip to content

Commit

Permalink
fix: wrong url in next/prev button in some cases (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
hong4rc authored and endiliey committed May 18, 2019
1 parent 084a498 commit 1587810
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/docusaurus-1.x/lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const {idx, getGitLastUpdatedTime, getGitLastUpdatedBy} = require('./utils.js');
class DocsLayout extends React.Component {
getRelativeURL = (from, to) => {
const extension = this.props.config.cleanUrl ? '' : '.html';
const relativeHref =
path
.relative(from, to)
.replace('\\', '/')
.replace(/^\.\.\//, '') + extension;
const relativeHref = path
.relative(`${from}.html`, `${to}.html`)
.replace('\\', '/')
.replace(/^\.\.\//, '')
.replace(/\.html$/, extension);
return url.resolve(
`${this.props.config.baseUrl}${this.props.metadata.permalink}`,
relativeHref,
Expand Down

0 comments on commit 1587810

Please sign in to comment.