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:
Joel Marcey 2017-12-14 09:32:49 -08:00 committed by GitHub
parent bee98053c8
commit d6fb14cfa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 171 additions and 1 deletions

View file

@ -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