mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +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 {
|
class DocsLayout extends React.Component {
|
||||||
getRelativeURL = (from, to) => {
|
getRelativeURL = (from, to) => {
|
||||||
const extension = this.props.config.cleanUrl ? '' : '.html';
|
const extension = this.props.config.cleanUrl ? '' : '.html';
|
||||||
const relativeHref =
|
const relativeHref = path
|
||||||
path
|
.relative(`${from}.html`, `${to}.html`)
|
||||||
.relative(from, to)
|
|
||||||
.replace('\\', '/')
|
.replace('\\', '/')
|
||||||
.replace(/^\.\.\//, '') + extension;
|
.replace(/^\.\.\//, '')
|
||||||
|
.replace(/\.html$/, extension);
|
||||||
return url.resolve(
|
return url.resolve(
|
||||||
`${this.props.config.baseUrl}${this.props.metadata.permalink}`,
|
`${this.props.config.baseUrl}${this.props.metadata.permalink}`,
|
||||||
relativeHref,
|
relativeHref,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue