Skip to content

Commit

Permalink
Merge pull request #117 from wri/develop
Browse files Browse the repository at this point in the history
PROD Deploy 2023-12-19 12:13am EST
  • Loading branch information
wri7tno authored Dec 19, 2023
2 parents ee5d0ff + 3e500ad commit 7aee08c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion layouts/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,27 @@ export default function Layout(props) {
return null;
};

const filterYoastTags = (yoastString) => {
let filteredText = yoastString;
// removing "Written By" and "Est. reading time" meta tags as requested in FLAG-977
const regexes = [
/<meta name="twitter:label1" content="[^"]*" \/>/i,
/<meta name="twitter:data1" content="[^"]*" \/>/i,
/<meta name="twitter:label2" content="[^"]*" \/>/i,
/<meta name="twitter:data2" content="[^"]*" \/>/i,
/<meta name="author" content="[^"]*" \/>/i,
];

regexes.forEach((regex) => {
filteredText = filteredText.replace(regex, '');
});

return filteredText;
};

const isProduction = process.env.NEXT_PUBLIC_FEATURE_ENV === 'production';
const canonicalLink = getCanonicalLink(yoast);
const yoastMetaTags = ReactHtmlParser(parseYoast(yoast));
const yoastMetaTags = ReactHtmlParser(filterYoastTags(parseYoast(yoast)));

return (
<>
Expand Down

0 comments on commit 7aee08c

Please sign in to comment.