mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 09:07:29 +02:00
Enable clean / extension-less url (#677)
This commit is contained in:
parent
aee255219b
commit
31f0c27f81
14 changed files with 124 additions and 50 deletions
|
@ -8,7 +8,7 @@
|
|||
const MarkdownBlock = require('./MarkdownBlock.js');
|
||||
const React = require('react');
|
||||
|
||||
const utils = require('./utils');
|
||||
const utils = require('./utils.js');
|
||||
|
||||
// inner blog component for the article itself, without sidebar/header/footer
|
||||
class BlogPost extends React.Component {
|
||||
|
@ -24,7 +24,12 @@ class BlogPost extends React.Component {
|
|||
<a
|
||||
className="button"
|
||||
href={
|
||||
this.props.config.baseUrl + 'blog/' + this.props.post.path
|
||||
this.props.config.baseUrl +
|
||||
'blog/' +
|
||||
utils.getPath(
|
||||
this.props.post.path,
|
||||
this.props.config.cleanUrl
|
||||
)
|
||||
}>
|
||||
Read More
|
||||
</a>
|
||||
|
@ -73,7 +78,12 @@ class BlogPost extends React.Component {
|
|||
const post = this.props.post;
|
||||
return (
|
||||
<h1>
|
||||
<a href={this.props.config.baseUrl + 'blog/' + post.path}>
|
||||
<a
|
||||
href={
|
||||
this.props.config.baseUrl +
|
||||
'blog/' +
|
||||
utils.getPath(post.path, this.props.config.cleanUrl)
|
||||
}>
|
||||
{post.title}
|
||||
</a>
|
||||
</h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue