mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Include canonical link in project meta tags
This will tell crawlers that this page and all its exact duplicates (/fullscreen, /editor, /embed, etc...) should be considered the same and use the project page as the canonical crawled page. We had an issue before where by not selected a canonical, google was considering all the project pages duplicates :(
This commit is contained in:
parent
8f84051a86
commit
aa6e85d863
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
rel="canonical"
|
||||
href={`https://scratch.mit.edu/projects/${id}`}
|
||||
/>
|
||||
</Helmet>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue