Skip to content

Commit 353b0b1

Browse files
author
digin
committed
fixed titles for pages
1 parent 820c0c6 commit 353b0b1

File tree

5 files changed

+74
-15
lines changed

5 files changed

+74
-15
lines changed

src/pages/AboutPage.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// src/pages/AboutPage.jsx
21
import React, { useEffect, useState } from 'react';
2+
import { Helmet } from 'react-helmet-async';
33
import About from '../components/sections/About';
44
import useGithubIssues from '../hooks/useGithubIssues';
55

@@ -83,6 +83,10 @@ const AboutPage = () => {
8383

8484
return (
8585
<BgWrapper>
86+
<Helmet>
87+
<title>About Me | Digin Dominic</title>
88+
<meta name="description" content="Learn about Digin Dominic - my background, skills, and experience as a software engineer." />
89+
</Helmet>
8690
<div className="pt-28">
8791
<header className="container mx-auto px-4 text-center mb-1">
8892
<h1 className="title mb-4">About <span>Me</span></h1>

src/pages/BlogPage.jsx

+21-11
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,19 @@ const BlogPage = () => {
123123
const [activeTag, setActiveTag] = useState(searchParams.get('tag') || '');
124124
const [allTags, setAllTags] = useState([]);
125125
const [filteredPosts, setFilteredPosts] = useState([]);
126+
const [pageTitle, setPageTitle] = useState('Blog | Digin Dominic');
126127

127128
const { issues: blogPosts, loading: blogPostsLoading, error } = useGithubIssues('blog', null);
128129

130+
// Update title when the active tag changes
131+
useEffect(() => {
132+
if (activeTag) {
133+
setPageTitle(`${activeTag} Blog Posts | Digin Dominic`);
134+
} else {
135+
setPageTitle('Blog | Digin Dominic');
136+
}
137+
}, [activeTag]);
138+
129139
useEffect(() => {
130140
if (Array.isArray(blogPosts) && blogPosts.length > 0) {
131141
// Extract all unique tags from blog posts
@@ -170,7 +180,7 @@ const BlogPage = () => {
170180
<BgWrapper>
171181
<section className="py-12 pt-28">
172182
<Helmet>
173-
<title>Loading Blog | Your Portfolio Website</title>
183+
<title>Loading Blog | Digin Dominic</title>
174184
<meta name="description" content="Loading blog posts..." />
175185
</Helmet>
176186
<div className="container mx-auto px-4">
@@ -189,7 +199,7 @@ const BlogPage = () => {
189199
<BgWrapper>
190200
<section className="py-12 pt-28">
191201
<Helmet>
192-
<title>Blog Error | Your Portfolio Website</title>
202+
<title>Blog Error | Digin Dominic</title>
193203
<meta name="description" content="An error occurred while loading blog posts." />
194204
</Helmet>
195205
<div className="container mx-auto px-4">
@@ -207,30 +217,30 @@ const BlogPage = () => {
207217
<BgWrapper>
208218
<section className="py-12 pt-28">
209219
<Helmet>
210-
<title>{activeTag ? `${activeTag} Blog Posts | Your Portfolio Website` : 'Blog | Your Portfolio Website'}</title>
220+
<title>{pageTitle}</title>
211221
<meta
212222
name="description"
213223
content={activeTag
214-
? `Explore ${activeTag} blog posts on Your Portfolio Website.`
215-
: 'Explore the latest blog posts on various topics from Your Portfolio Website.'}
224+
? `Explore ${activeTag} blog posts by Digin Dominic.`
225+
: 'Explore the latest blog posts on various topics from Digin Dominic.'}
216226
/>
217227
<meta
218228
name="keywords"
219-
content={`blog, articles, ${activeTag || ''}, portfolio, Your Portfolio Website`}
229+
content={`blog, articles, ${activeTag || ''}, portfolio, Digin Dominic`}
220230
/>
221231
{/* Open Graph Tags */}
222-
<meta property="og:title" content={activeTag ? `${activeTag} Blog Posts | Your Portfolio Website` : 'Blog | Your Portfolio Website'} />
232+
<meta property="og:title" content={pageTitle} />
223233
<meta
224234
property="og:description"
225235
content={activeTag
226-
? `Explore ${activeTag} blog posts on Your Portfolio Website.`
227-
: 'Explore the latest blog posts on various topics from Your Portfolio Website.'}
236+
? `Explore ${activeTag} blog posts by Digin Dominic.`
237+
: 'Explore the latest blog posts on various topics from Digin Dominic.'}
228238
/>
229239
<meta property="og:type" content="website" />
230-
<meta property="og:url" content={`https://yourdomain.com/blog${activeTag ? `?tag=${activeTag}` : ''}`} />
240+
<meta property="og:url" content={`https://digindominic.me/blog${activeTag ? `?tag=${activeTag}` : ''}`} />
231241
<meta
232242
property="og:image"
233-
content="https://yourdomain.com/default-blog-image.jpg"
243+
content="https://raw.githubusercontent.com/digin1/web-images/refs/heads/main/digin.png"
234244
/>
235245
</Helmet>
236246
<div className="container mx-auto px-4">

src/pages/HomePage.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// src/pages/HomePage.jsx
21
import React from 'react';
2+
import { Helmet } from 'react-helmet-async';
33
import Hero from '../components/sections/Hero';
44
import Projects from '../components/sections/Projects';
55
import Toolkit from '../components/sections/Toolkit';
@@ -69,6 +69,10 @@ const HomePage = () => {
6969

7070
return (
7171
<>
72+
<Helmet>
73+
<title>Digin Dominic | Software Engineer</title>
74+
<meta name="description" content="Digin Dominic - Software Engineer, Research Toolsmith, and Data Workflow Architect" />
75+
</Helmet>
7276
<Hero content={heroContent} loading={heroLoading} />
7377
<Projects projects={projects} loading={projectsLoading} />
7478
<Toolkit />

src/pages/NotFoundPage.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
// src/pages/NotFoundPage.jsx
21
import React from 'react';
32
import { Link } from 'react-router-dom';
3+
import { Helmet } from 'react-helmet-async';
44

55
const NotFoundPage = () => {
66
return (
77
<div className="container mx-auto px-4 py-16">
8+
<Helmet>
9+
<title>Page Not Found | Digin Dominic</title>
10+
<meta name="description" content="The page you are looking for doesn't exist or has been moved." />
11+
</Helmet>
812
<div className="max-w-lg mx-auto text-center">
913
<h1 className="text-4xl font-bold text-gray-800 mb-4">404 - Page Not Found</h1>
1014
<p className="text-gray-600 mb-8">

src/pages/ProjectsPage.jsx

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// src/pages/ProjectsPage.jsx (Shows all projects with tag filtering)
1+
// src/pages/ProjectsPage.jsx
22
import React, { useState, useEffect } from 'react';
33
import { Link, useSearchParams } from 'react-router-dom';
4+
import { Helmet } from 'react-helmet-async';
45
import useGithubIssues from '../hooks/useGithubIssues';
56
import { parseCustomDate, formatDateAsDDMMYYYY } from '../utils/dateUtils';
67

@@ -108,12 +109,22 @@ const ProjectsPage = () => {
108109
const [activeTag, setActiveTag] = useState(searchParams.get('tag') || '');
109110
const [allTags, setAllTags] = useState([]);
110111
const [filteredProjects, setFilteredProjects] = useState([]);
112+
const [pageTitle, setPageTitle] = useState('Projects | Digin Dominic');
111113

112114
const {
113115
issues: projects,
114116
loading: projectsLoading
115117
} = useGithubIssues('project', null);
116118

119+
// Update title when the active tag changes
120+
useEffect(() => {
121+
if (activeTag) {
122+
setPageTitle(`${activeTag} Projects | Digin Dominic`);
123+
} else {
124+
setPageTitle('Projects | Digin Dominic');
125+
}
126+
}, [activeTag]);
127+
117128
useEffect(() => {
118129
if (Array.isArray(projects) && projects.length > 0) {
119130
// Extract all unique tags from projects
@@ -155,6 +166,10 @@ const ProjectsPage = () => {
155166
if (projectsLoading) {
156167
return (
157168
<div className="container mx-auto px-4 py-12 pt-28">
169+
<Helmet>
170+
<title>Loading Projects | Digin Dominic</title>
171+
<meta name="description" content="Browse my portfolio of projects and development work" />
172+
</Helmet>
158173
<div className="text-center mb-12">
159174
<h2 className="title mb-4">My <span>Projects</span></h2>
160175
<p className="max-w-2xl mx-auto text-gray-600">Explore the projects I've been working on</p>
@@ -187,6 +202,28 @@ const ProjectsPage = () => {
187202

188203
return (
189204
<div className="container mx-auto px-4 py-12 pt-28">
205+
<Helmet>
206+
<title>{pageTitle}</title>
207+
<meta
208+
name="description"
209+
content={activeTag
210+
? `Explore my ${activeTag} projects and portfolio work`
211+
: 'Browse my portfolio of projects, applications, and development work'
212+
}
213+
/>
214+
{/* Open Graph Tags */}
215+
<meta property="og:title" content={pageTitle} />
216+
<meta
217+
property="og:description"
218+
content={activeTag
219+
? `Explore my ${activeTag} projects and portfolio work`
220+
: 'Browse my portfolio of projects, applications, and development work'
221+
}
222+
/>
223+
<meta property="og:type" content="website" />
224+
<meta property="og:url" content={`https://digindominic.me/projects${activeTag ? `?tag=${activeTag}` : ''}`} />
225+
<meta property="og:image" content="https://raw.githubusercontent.com/digin1/web-images/refs/heads/main/digin.png" />
226+
</Helmet>
190227
<div className="text-center mb-8">
191228
<h2 className="title mb-4">My <span>Projects</span></h2>
192229
<p className="max-w-2xl mx-auto text-gray-600 mb-6">Explore the projects I've been working on</p>

0 commit comments

Comments
 (0)