From c2243a3c2071afb562b8802f9376d83a0e252f02 Mon Sep 17 00:00:00 2001 From: Eric Nakagawa Date: Tue, 24 Oct 2017 13:46:42 -0700 Subject: [PATCH] Only show 'Read More' button on blog list page when post has token (#161) * Only show 'Read More' button on blog list page when the text includes a token * Remove console.log --- lib/core/BlogPost.js | 41 +++++++++++++-------------- website/blog/2017-09-26-adding-rss.md | 2 -- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/lib/core/BlogPost.js b/lib/core/BlogPost.js index ccc6ef0537..6307224399 100644 --- a/lib/core/BlogPost.js +++ b/lib/core/BlogPost.js @@ -12,36 +12,35 @@ const React = require("react"); class BlogPost extends React.Component { renderContent() { let content = this.props.content; + let hasSplit = false; + if (content.split("").length > 1) { + hasSplit = ( +
+ + Read More + +
+ ); + } if (this.props.truncate) { content = content.split("")[0]; return ( ); } - return ( - - {content} - - ); + return {content}; } renderAuthorPhoto() { const post = this.props.post; - const className = "authorPhoto" + ((post.author && post.authorTitle) - ? " authorPhoto-big" - : ""); + const className = + "authorPhoto" + + (post.author && post.authorTitle ? " authorPhoto-big" : ""); if (post.authorFBID) { return (
@@ -60,9 +59,7 @@ class BlogPost extends React.Component { return (
- +
); diff --git a/website/blog/2017-09-26-adding-rss.md b/website/blog/2017-09-26-adding-rss.md index bc40431b03..eeb4f0477e 100644 --- a/website/blog/2017-09-26-adding-rss.md +++ b/website/blog/2017-09-26-adding-rss.md @@ -7,6 +7,4 @@ authorFBID: 661277173 This is a test post. - - A whole bunch of other information.