Skip to content

Commit 2f3d19f

Browse files
committed
Fix SEO: unique descriptions, OG dimensions, structured data, 404 status
- Add unique meta descriptions to all pages (index, about, cv, posts, tags, archives, search) - Pass description from AboutLayout frontmatter to Layout head - Add OG image dimensions (1200x630), og:site_name, og:locale - Add Twitter image dimensions and twitter:creator - Improve structured data: Person schema with sameAs social links, description on WebSite - Set HTTP 404 status code on 404 page
1 parent 9d308d8 commit 2f3d19f

11 files changed

Lines changed: 30 additions & 20 deletions

File tree

src/layouts/AboutLayout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import Breadcrumb from "@/components/Breadcrumb.astro";
66
import Layout from "./Layout.astro";
77
import { SITE } from "@/config";
88
9-
type Props = MarkdownLayoutProps<{ title: string }>;
9+
type Props = MarkdownLayoutProps<{ title: string; description?: string }>;
1010
1111
const { frontmatter } = Astro.props;
1212
---
1313

14-
<Layout title={`${frontmatter.title} | ${SITE.title}`}>
14+
<Layout title={`${frontmatter.title} | ${SITE.title}`} description={frontmatter.description}>
1515
<Header />
1616
<Breadcrumb />
1717
<main id="main-content" class="app-layout">

src/layouts/Layout.astro

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ const {
3131
3232
const socialImageURL = new URL(ogImage, Astro.url);
3333
34+
const personSchema = {
35+
"@type": "Person",
36+
name: `${author}`,
37+
url: "https://argha.dev",
38+
...(profile && { sameAs: [profile, "https://www.linkedin.com/in/argha94", "https://x.com/argharay94"] }),
39+
};
40+
3441
const structuredData = pubDatetime
3542
? {
3643
"@context": "https://schema.org",
@@ -39,24 +46,15 @@ const structuredData = pubDatetime
3946
image: `${socialImageURL}`,
4047
datePublished: pubDatetime.toISOString(),
4148
...(modDatetime && { dateModified: modDatetime.toISOString() }),
42-
author: [
43-
{
44-
"@type": "Person",
45-
name: `${author}`,
46-
...(profile && { url: profile }),
47-
},
48-
],
49+
author: [personSchema],
4950
}
5051
: {
5152
"@context": "https://schema.org",
5253
"@type": "WebSite",
5354
name: `${title}`,
5455
url: `${canonicalURL}`,
55-
author: {
56-
"@type": "Person",
57-
name: `${author}`,
58-
...(profile && { url: profile }),
59-
},
56+
description: `${description}`,
57+
author: personSchema,
6058
};
6159
---
6260

@@ -100,6 +98,11 @@ const structuredData = pubDatetime
10098
<meta property="og:description" content={description} />
10199
<meta property="og:url" content={canonicalURL} />
102100
<meta property="og:image" content={socialImageURL} />
101+
<meta property="og:image:width" content="1200" />
102+
<meta property="og:image:height" content="630" />
103+
<meta property="og:image:type" content="image/png" />
104+
<meta property="og:site_name" content={SITE.title} />
105+
<meta property="og:locale" content="en_US" />
103106

104107
<!-- Article Published/Modified time -->
105108
{
@@ -125,6 +128,9 @@ const structuredData = pubDatetime
125128
<meta property="twitter:title" content={title} />
126129
<meta property="twitter:description" content={description} />
127130
<meta property="twitter:image" content={socialImageURL} />
131+
<meta property="twitter:image:width" content="1200" />
132+
<meta property="twitter:image:height" content="630" />
133+
<meta name="twitter:creator" content="@argharay94" />
128134

129135
<!-- Google JSON-LD Structured data -->
130136
<script

src/pages/404.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import Header from "@/components/Header.astro";
44
import Footer from "@/components/Footer.astro";
55
import LinkButton from "@/components/LinkButton.astro";
66
import { SITE } from "@/config";
7+
8+
Astro.response.status = 404;
79
---
810

911
<Layout title={`404 Not Found | ${SITE.title}`}>

src/pages/about.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: ../layouts/AboutLayout.astro
33
title: "About"
4+
description: "Argha Ray — software engineer with nine years in production backend systems at Motorola Solutions. Building agent infrastructure, tool orchestration, and knowledge systems. Based in Bangalore, open to remote roles in Europe."
45
---
56

67
I'm Argha — a software engineer in Bangalore with nine years of building things that run in production.

src/pages/archives/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const months = [
3131
];
3232
---
3333

34-
<Layout title={`Archives | ${SITE.title}`}>
34+
<Layout title={`Archives | ${SITE.title}`} description="All articles by Argha Ray, organized by date.">
3535
<Header />
3636
<Main pageTitle="Archives" pageDesc="All the articles I've archived.">
3737
{

src/pages/cv.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: ../layouts/AboutLayout.astro
33
title: "CV"
4+
description: "CV of Argha Ray — Senior Software Engineer at Motorola Solutions. Nine years in Java, C#, TypeScript, Python. RBAC engines, HA PostgreSQL, deployment tooling, agent engineering. Open to remote roles."
45
---
56

67
# Argha Ray

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
1919
const allPosts = [...featuredPosts, ...recentPosts];
2020
---
2121

22-
<Layout>
22+
<Layout description="Argha Ray — software engineer at Motorola Solutions. Nine years in production backend systems. Building agent infrastructure and writing about what works.">
2323
<Header />
2424
<main id="main-content" data-layout="index" class="app-layout">
2525
<!-- Intro -->

src/pages/posts/[...page].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const getStaticPaths = (async ({ paginate }) => {
1818
const { page } = Astro.props;
1919
---
2020

21-
<Layout title={`Posts | ${SITE.title}`}>
21+
<Layout title={`Posts | ${SITE.title}`} description="Articles on backend systems, agent engineering, streaming architecture, and building real things.">
2222
<Header />
2323
<Main pageTitle="Posts" pageDesc="All the articles I've posted.">
2424
<ul>

src/pages/search.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { SITE } from "@/config";
99
const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/";
1010
---
1111

12-
<Layout title={`Search | ${SITE.title}`}>
12+
<Layout title={`Search | ${SITE.title}`} description="Search articles on argha.dev.">
1313
<Header />
1414
<Main pageTitle="Search" pageDesc="Search any article ...">
1515
<div id="pagefind-search" transition:persist data-backurl={backUrl}></div>

src/pages/tags/[tag]/[...page].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const { tag } = params;
3131
const { page, tagName } = Astro.props;
3232
---
3333

34-
<Layout title={`Tag: ${tagName} | ${SITE.title}`}>
34+
<Layout title={`Tag: ${tagName} | ${SITE.title}`} description={`Articles tagged "${tagName}" by Argha Ray.`}>
3535
<Header />
3636
<Main
3737
pageTitle={[`Tag:`, `${tagName}`]}

0 commit comments

Comments
 (0)