Merge pull request from LLK/canonical-link

Include canonical link in project meta tags
This commit is contained in:
Paul Kaplan 2019-09-23 10:21:59 -04:00 committed by GitHub
commit e2e9bb8db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ const Helmet = require('react-helmet').default;
const projectShape = require('./projectshape.jsx').projectShape;
const Meta = props => {
const {title, instructions, author} = props.projectInfo;
const {id, title, instructions, author} = props.projectInfo;
// Do not want to render any meta tags unless all the info is loaded
// Check only author (object) because it is ok to have empty string instructions
@ -29,6 +29,10 @@ const Meta = props => {
content={truncatedInstructions}
property="og:description"
/>
<link
href={`https://scratch.mit.edu/projects/${id}`}
rel="canonical"
/>
</Helmet>
);
};