From 903e28ee6afcaa1b4fc1dc1ec0d9ac2f9c920b22 Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Fri, 24 Aug 2018 06:15:33 +0100 Subject: [PATCH] feat(meta): Add article meta (#18044) --- news/routes/Featured/Featured.js | 1 + news/routes/Show/Show.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/news/routes/Featured/Featured.js b/news/routes/Featured/Featured.js index f5eb275bbe..ac5dd9d506 100644 --- a/news/routes/Featured/Featured.js +++ b/news/routes/Featured/Featured.js @@ -152,6 +152,7 @@ class Featured extends Component {
+ Featured | freeCodeCamp News
diff --git a/news/routes/Show/Show.js b/news/routes/Show/Show.js index 2598e119f9..6412583b09 100644 --- a/news/routes/Show/Show.js +++ b/news/routes/Show/Show.js @@ -177,10 +177,26 @@ class ShowArticle extends Component { return

Oh noes!! Something went wrong!

; } + // RegEx finds the first paragraph and groups the content + const description = renderableContent.match(/

(.*?)<\/p>/)[1]; + const slug = this.props.location.pathname; return (

+ {`${title} | freeCodeCamp News`} + + + + + +

{title}