Skip to content

Commit

Permalink
feat: improve SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
bntnam committed Apr 3, 2022
1 parent 97eb8a5 commit d0d304f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
4 changes: 3 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module.exports = {
title: "Software Engineer - Nam Bui",
author: "Nam Bui",
description:
"Nam is a Software Engineer with years of professional experience building global products in various markets for millions of users.",
"Nam is a Software Engineer with years of professional experience building global products for millions of users.",
siteUrl: "https://bntnam.com",
imageUrl: "/img/profile/profile.jpg",
},
plugins: [
"gatsby-plugin-react-helmet",
Expand Down
46 changes: 30 additions & 16 deletions src/components/templates/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,40 @@ const Layout = ({ children, location }) => {
title
author
description
siteUrl
imageUrl
}
}
}
`}
render={data => (
<>
<Helmet
title={data.site.siteMetadata.title}
link={[{ rel: "shortcut icon", href: "/logo.ico" }]}
>
<meta name="author" content={data.site.siteMetadata.author} />
<meta
name="description"
content={data.site.siteMetadata.description}
/>
</Helmet>
<GlobalStyle />
{content}
</>
)}
render={data => {
const {
title,
author,
description,
siteUrl,
imageUrl,
} = data.site.siteMetadata;

return (
<>
<Helmet
title={title}
link={[{ rel: "shortcut icon", href: "/logo.ico" }]}
>
<meta name="author" content={author} />
<meta name="description" content={description} />
<meta property="og:url" content={siteUrl} />
<meta property="og:title" content={title} />
<meta property="og:author" content={author} />
<meta property="og:description" content={description} />
<meta property="og:image" content={`${siteUrl}${imageUrl}`} />
</Helmet>
<GlobalStyle />
{content}
</>
);
}}
/>
);
};
Expand Down
Binary file added static/img/profile/profile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0d304f

Please sign in to comment.