From 1587810e8f53b2f50593629b8782fe1cf8bfa483 Mon Sep 17 00:00:00 2001 From: Hongarc Date: Sat, 18 May 2019 13:29:13 +0700 Subject: [PATCH] fix: wrong url in next/prev button in some cases (#1488) --- packages/docusaurus-1.x/lib/core/DocsLayout.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus-1.x/lib/core/DocsLayout.js b/packages/docusaurus-1.x/lib/core/DocsLayout.js index 1cd86a53e82d..6e2e7d028b5d 100644 --- a/packages/docusaurus-1.x/lib/core/DocsLayout.js +++ b/packages/docusaurus-1.x/lib/core/DocsLayout.js @@ -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,