Skip to content

Commit 8de6b47

Browse files
Added SEO Related settings
1 parent e954f96 commit 8de6b47

6 files changed

Lines changed: 57 additions & 3 deletions

File tree

package-lock.json

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"react-bootstrap": "^1.0.0-beta.16",
2929
"react-chartjs-2": "^2.9.0",
3030
"react-dom": "^16.10.2",
31+
"react-helmet": "^6.1.0",
3132
"react-reveal": "^1.2.2",
3233
"react-router-dom": "^5.1.2",
3334
"react-scripts": "3.2.0",

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<!-- <link rel="icon" href="%PUBLIC_URL%/favicon1.ico" /> -->
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta
8-
name="Ashutosh's Portfolio"
9-
content="Web site created using create-react-app"
8+
name="Portfolio"
9+
content="Portfolio content"
1010
/>
1111
<meta property="og:title" content="Ashutosh Hathidara Portfolio" />
1212
<meta property="og:type" content="website" />

src/components/header/Header.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "./Header.css";
33
import { Fade } from "react-reveal";
44
import { NavLink, Link } from "react-router-dom";
55
import { greeting, settings } from "../../portfolio.js";
6+
import SeoHeader from "../seoHeader/SeoHeader";
67

78
const onMouseEnter = (event, color) => {
89
const el = event.target;
@@ -21,6 +22,7 @@ class Header extends Component {
2122
const link = settings.isSplash ? "/splash" : "home";
2223
return (
2324
<Fade top duration={1000} distance="20px">
25+
<SeoHeader />
2426
<div>
2527
<header className="header">
2628
<NavLink to={link} tag={Link} className="logo">
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
import { Helmet } from "react-helmet";
3+
import { seo } from "../../portfolio.js";
4+
5+
function SeoHeader() {
6+
return (
7+
<Helmet>
8+
<title>{seo.title}</title>
9+
<meta name="description" content={seo.description} />
10+
<meta property="og:title" content={seo?.og?.title} />
11+
<meta property="og:type" content={seo?.og?.type} />
12+
<meta property="og:url" content={seo?.og?.url} />
13+
</Helmet>
14+
);
15+
}
16+
17+
export default SeoHeader;

src/portfolio.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ const settings = {
55
isSplash: true, // Change this to false if you don't want Splash screen.
66
};
77

8+
//SEO Related settings
9+
const seo = {
10+
title: "Ashutosh's Portfolio",
11+
description:
12+
"A passionate individual who always thrive to work on end to end products which develop sustainable and scalable social and technical systems to create impact.",
13+
og: {
14+
title: "Ashutosh Hathidara Portfolio",
15+
type: "website",
16+
url: "https://ashutosh1919.github.io/",
17+
},
18+
};
19+
820
//Home Page
921
const greeting = {
1022
title: "Ashutosh Hathidara",
@@ -659,6 +671,7 @@ const contactPageData = {
659671

660672
export {
661673
settings,
674+
seo,
662675
greeting,
663676
socialMediaLinks,
664677
skills,

0 commit comments

Comments
 (0)