mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
fix: wrong url in next/prev button in some cases (#1488)
This commit is contained in:
parent
084a49819f
commit
1587810e8f
1 changed files with 5 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue