Skip to content

Commit d4b71f4

Browse files
authored
feat: enhance Open Graph and Twitter metadata for improved sharing and SEO
1 parent e345eb4 commit d4b71f4

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

astro.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import mdx from "@astrojs/mdx";
22
import partytown from "@astrojs/partytown";
33
import sitemap from "@astrojs/sitemap";
44
import solid from "@astrojs/solid-js";
5+
import rehypeD2 from "@beoe/rehype-d2";
56
import tailwindcss from "@tailwindcss/vite";
67
import AstroPWA from "@vite-pwa/astro";
78
import { defineConfig } from "astro/config";
8-
import rehypeD2 from "@beoe/rehype-d2";
99
import rehypeCopyCodeButton from "./src/lib/rehypeCopyCodeButton";
1010

1111
// https://astro.build/config

src/components/HeadSEO.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const {
6161
<meta property="og:image:alt" content={title} />
6262
<meta property="og:image:width" content="1200" />
6363
<meta property="og:image:height" content="630" />
64+
<meta property="og:image:type" content="image/png" />
6465
<meta property="og:site_name" content="Avaab Razzaq - AI Growth Engineer" />
6566
<meta property="og:locale" content="en_US" />
6667

@@ -71,6 +72,10 @@ const {
7172
<meta name="twitter:description" content={description} />
7273
<meta name="twitter:image" content={ogImage} />
7374
<meta name="twitter:image:alt" content={title} />
75+
<meta name="twitter:label1" content="Built by" />
76+
<meta name="twitter:data1" content="Avaab Razzaq" />
77+
<meta name="twitter:label2" content="Based in" />
78+
<meta name="twitter:data2" content="Miami, FL" />
7479

7580
<meta name="theme-color" content="#01696f" media="(prefers-color-scheme: light)" />
7681
<meta name="theme-color" content="#4f98a3" media="(prefers-color-scheme: dark)" />

src/layouts/BaseLayout.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const currentPath = Astro.url.pathname;
6666
<!doctype html>
6767
<html lang="en" class="scroll-smooth">
6868
<head>
69+
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
70+
<link rel="dns-prefetch" href="https://fonts.gstatic.com" />
6971
{shouldLoadAnalytics && (
7072
<>
7173
<!-- Google Analytics -->
@@ -85,6 +87,7 @@ const currentPath = Astro.url.pathname;
8587
/>
8688

8789
{publishedTime && <meta property="article:published_time" content={publishedTime} />}
90+
{publishedTime && <meta property="article:author" content={author} />}
8891
{modifiedTime && <meta property="article:modified_time" content={modifiedTime} />}
8992

9093
<script is:inline set:html={themeInitScript}></script>

0 commit comments

Comments
 (0)