@@ -123,9 +123,19 @@ const BlogPage = () => {
123
123
const [ activeTag , setActiveTag ] = useState ( searchParams . get ( 'tag' ) || '' ) ;
124
124
const [ allTags , setAllTags ] = useState ( [ ] ) ;
125
125
const [ filteredPosts , setFilteredPosts ] = useState ( [ ] ) ;
126
+ const [ pageTitle , setPageTitle ] = useState ( 'Blog | Digin Dominic' ) ;
126
127
127
128
const { issues : blogPosts , loading : blogPostsLoading , error } = useGithubIssues ( 'blog' , null ) ;
128
129
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
+
129
139
useEffect ( ( ) => {
130
140
if ( Array . isArray ( blogPosts ) && blogPosts . length > 0 ) {
131
141
// Extract all unique tags from blog posts
@@ -170,7 +180,7 @@ const BlogPage = () => {
170
180
< BgWrapper >
171
181
< section className = "py-12 pt-28" >
172
182
< Helmet >
173
- < title > Loading Blog | Your Portfolio Website </ title >
183
+ < title > Loading Blog | Digin Dominic </ title >
174
184
< meta name = "description" content = "Loading blog posts..." />
175
185
</ Helmet >
176
186
< div className = "container mx-auto px-4" >
@@ -189,7 +199,7 @@ const BlogPage = () => {
189
199
< BgWrapper >
190
200
< section className = "py-12 pt-28" >
191
201
< Helmet >
192
- < title > Blog Error | Your Portfolio Website </ title >
202
+ < title > Blog Error | Digin Dominic </ title >
193
203
< meta name = "description" content = "An error occurred while loading blog posts." />
194
204
</ Helmet >
195
205
< div className = "container mx-auto px-4" >
@@ -207,30 +217,30 @@ const BlogPage = () => {
207
217
< BgWrapper >
208
218
< section className = "py-12 pt-28" >
209
219
< Helmet >
210
- < title > { activeTag ? ` ${ activeTag } Blog Posts | Your Portfolio Website` : 'Blog | Your Portfolio Website' } </ title >
220
+ < title > { pageTitle } </ title >
211
221
< meta
212
222
name = "description"
213
223
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 .' }
216
226
/>
217
227
< meta
218
228
name = "keywords"
219
- content = { `blog, articles, ${ activeTag || '' } , portfolio, Your Portfolio Website ` }
229
+ content = { `blog, articles, ${ activeTag || '' } , portfolio, Digin Dominic ` }
220
230
/>
221
231
{ /* 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 } />
223
233
< meta
224
234
property = "og:description"
225
235
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 .' }
228
238
/>
229
239
< 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 } ` : '' } ` } />
231
241
< meta
232
242
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 "
234
244
/>
235
245
</ Helmet >
236
246
< div className = "container mx-auto px-4" >
0 commit comments