Add support for video embeds in blog posts.

Summary:
Similar to the Hero image functionality. If a video URL is present in the post metadata, it will be displayed instead of a Hero image. This will be useful when highlighting videos in blog posts.

Renamed ReadMoreLink into a more generic ExceptLink which will display "Watch video" when the blog post category is "videos".

Currently there is no way of listing blog posts by categories, but it may be useful to do so later once we have a larger catalog of content.
Closes https://github.com/facebook/react-native/pull/9794

Differential Revision: D3828862

Pulled By: mkonicek

fbshipit-source-id: 1a88aab5edcdf7c84bb679263d6b97d52cf201a2
This commit is contained in:
Héctor Ramos
2016-09-07 11:15:44 -07:00
committed by Facebook Github Bot 3
parent 8aeeb4d6a0
commit e22abd91bf
8 changed files with 43 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ var Marked = require('Marked');
var React = require('React');
var BlogPostHeader = require('BlogPostHeader');
var BlogPostFooter = require('BlogPostFooter');
var ReadMoreLink = require('ReadMoreLink');
var ExcerptLink = require('ExcerptLink');
var BlogPost = React.createClass({
render: function() {
@@ -37,7 +37,7 @@ var BlogPost = React.createClass({
if (this.props.excerpt) {
content = content.trim().split('\n')[0];
footer = <ReadMoreLink href={'/react-native/blog/' + post.path} />;
footer = <ExcerptLink href={'/react-native/blog/' + post.path} category={post.category} />;
}
return (