Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use absoluteURL instead of relativeURL for next/prev links #783

Merged
merged 3 commits into from
Jun 17, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ const OnPageNav = require('./nav/OnPageNav.js');
const Site = require('./Site.js');
const translation = require('../server/translation.js');
const path = require('path');
const url = require('url');

// component used to generate whole webpage for docs, including sidebar/header/footer
class DocsLayout extends React.Component {
getRelativeURL = (from, to) => {
const extension = this.props.config.cleanUrl ? '' : '.html';
return (
const relativeHref =
path
.relative(from, to)
.replace('\\', '/')
.replace(/^\.\.\//, '') + extension
);
.replace(/^\.\.\//, '') + extension;
return url.resolve(`/${this.props.metadata.permalink}`, relativeHref);
};

render() {
Expand Down