Skip to content

Commit

Permalink
Add rel canonical to story pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zarathustra323 committed Aug 13, 2018
1 parent 977a243 commit e6a2c3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gql/fragments/story/view.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fragment StoryViewFragment on Story {
id
title
teaser
url
publishedAt
advertiser {
id
Expand Down
3 changes: 2 additions & 1 deletion src/pages/story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ const Story = ({ id, preview }) => {
return <ErrorAlert message={error.message} />;
}
const { publishedStory } = data;
const { title, teaser } = publishedStory;
const { title, teaser, url } = publishedStory;
return (
<Fragment>
<TrackPageView params={{ story_id: id, page_title: title }} />
<Title value={title} />
<Head>
<meta name="description" content={teaser} />
<link rel="canonical" href={url} />
</Head>
<StoryView {...publishedStory} />
</Fragment>
Expand Down

0 comments on commit e6a2c3b

Please sign in to comment.