mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
Add introductory blog post (#279)
* Add introductory blog post For launch! \o/ * Update post to launch date * Add ogImage and fix how we get og:Description Plus a few updates to the post * Remove some code block info
This commit is contained in:
parent
bee98053c8
commit
d6fb14cfa4
8 changed files with 171 additions and 1 deletions
|
@ -60,6 +60,17 @@ class BlogPostLayout extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
getDescription() {
|
||||
var descLines = this.props.children.trim().split('\n');
|
||||
for (var i = 0; i < descLines.length; i++) {
|
||||
// Don't want blank lines or descriptions that are raw image rendering strings
|
||||
if (descLines[i] && !descLines[i].startsWith("![")) {
|
||||
return descLines[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Site
|
||||
|
@ -67,7 +78,7 @@ class BlogPostLayout extends React.Component {
|
|||
url={'blog/' + this.props.metadata.path}
|
||||
title={this.props.metadata.title}
|
||||
language={'en'}
|
||||
description={this.props.children.trim().split('\n')[0]}
|
||||
description={this.getDescription()}
|
||||
config={this.props.config}>
|
||||
<div className="docMainWrapper wrapper">
|
||||
<BlogSidebar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue