mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 17:47:40 +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
|
@ -10,11 +10,13 @@ const BlogPost = require('./BlogPost.js');
|
|||
const BlogSidebar = require('./BlogSidebar.js');
|
||||
const Container = require('./Container.js');
|
||||
const Site = require('./Site.js');
|
||||
const utils = require('./utils.js');
|
||||
|
||||
// used for entire blog posts, i.e., each written blog article with sidebar with site header/footer
|
||||
class BlogPostLayout extends React.Component {
|
||||
renderSocialButtons() {
|
||||
const post = this.props.metadata;
|
||||
let post = this.props.metadata;
|
||||
post.path = utils.getPath(post.path, this.props.config.cleanUrl);
|
||||
|
||||
const fbComment = this.props.config.facebookAppId &&
|
||||
this.props.config.facebookComments && (
|
||||
|
@ -92,10 +94,12 @@ class BlogPostLayout extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
let post = this.props.metadata;
|
||||
post.path = utils.getPath(post.path, this.props.config.cleanUrl);
|
||||
return (
|
||||
<Site
|
||||
className="sideNavVisible"
|
||||
url={'blog/' + this.props.metadata.path}
|
||||
url={'blog/' + post.path}
|
||||
title={this.props.metadata.title}
|
||||
language={'en'}
|
||||
description={this.getDescription()}
|
||||
|
@ -104,13 +108,13 @@ class BlogPostLayout extends React.Component {
|
|||
<div className="docMainWrapper wrapper">
|
||||
<BlogSidebar
|
||||
language={'en'}
|
||||
current={this.props.metadata}
|
||||
current={post}
|
||||
config={this.props.config}
|
||||
/>
|
||||
<Container className="mainContainer documentContainer postContainer blogContainer">
|
||||
<div className="lonePost">
|
||||
<BlogPost
|
||||
post={this.props.metadata}
|
||||
post={post}
|
||||
content={this.props.children}
|
||||
language={'en'}
|
||||
config={this.props.config}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue