Skip to content

Commit 0004f62

Browse files
authored
✨ feat: enhance site configuration with trailing slashes, add CNAME and security headers, and improve metadata for SEO
1 parent 57f1b1d commit 0004f62

5 files changed

Lines changed: 65 additions & 2 deletions

File tree

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const tailwindPlugin = tailwindcss() as unknown as never;
1111
// https://astro.build/config
1212
export default defineConfig({
1313
site: "https://avaabrazzaq.com/", // Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs.
14+
trailingSlash: "always", // Consistent URL format - all URLs end with /
1415
vite: {
1516
plugins: [tailwindPlugin],
1617
},

public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
avaabrazzaq.com

public/_headers

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Security and performance headers for Cloudflare Pages
2+
# https://developers.cloudflare.com/pages/platform/headers/
3+
4+
/*
5+
X-Content-Type-Options: nosniff
6+
X-Frame-Options: SAMEORIGIN
7+
X-XSS-Protection: 1; mode=block
8+
Referrer-Policy: strict-origin-when-cross-origin
9+
Permissions-Policy: camera=(), microphone=(), geolocation=()
10+
Content-Security-Policy: upgrade-insecure-requests
11+
12+
# Cache static assets for 1 year
13+
/*.css
14+
Cache-Control: public, max-age=31536000, immutable
15+
16+
/*.js
17+
Cache-Control: public, max-age=31536000, immutable
18+
19+
/*.woff2
20+
Cache-Control: public, max-age=31536000, immutable
21+
22+
/*.woff
23+
Cache-Control: public, max-age=31536000, immutable
24+
25+
/*.svg
26+
Cache-Control: public, max-age=31536000, immutable
27+
28+
/*.png
29+
Cache-Control: public, max-age=31536000, immutable
30+
31+
/*.jpg
32+
Cache-Control: public, max-age=31536000, immutable
33+
34+
/*.webp
35+
Cache-Control: public, max-age=31536000, immutable
36+
37+
/*.avif
38+
Cache-Control: public, max-age=31536000, immutable
39+
40+
/*.ico
41+
Cache-Control: public, max-age=31536000, immutable
42+
43+
# HTML pages - shorter cache
44+
/*.html
45+
Cache-Control: public, max-age=3600, must-revalidate
46+
47+
/
48+
Cache-Control: public, max-age=3600, must-revalidate

src/layouts/BaseLayout.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ const currentPath = Astro.url.pathname;
6161
<meta name="ICBM" content="25.7617, -80.1918" />
6262

6363
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
64-
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
64+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
65+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
6566
<link rel="canonical" href={canonicalUrl} />
6667
<link rel="sitemap" href="/sitemap-index.xml" />
6768
<link rel="alternate" type="application/rss+xml" title="Avaab Razzaq Blog RSS Feed" href="/blog/rss.xml" />
@@ -81,6 +82,8 @@ const currentPath = Astro.url.pathname;
8182
<meta property="og:url" content={canonicalUrl} />
8283
<meta property="og:image" content={ogImage} />
8384
<meta property="og:image:alt" content={title} />
85+
<meta property="og:image:width" content="1200" />
86+
<meta property="og:image:height" content="630" />
8487
<meta property="og:site_name" content="Avaab Razzaq - AI Growth Engineer" />
8588
<meta property="og:locale" content="en_US" />
8689

src/layouts/Layout.astro

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ const shouldLoadAnalytics = import.meta.env.PROD && gaMeasurementId.length > 0;
4444
content="width=device-width, initial-scale=1.0, maximum-scale=5.0"
4545
/>
4646
<meta name="description" content={pageDescription} />
47+
<meta name="author" content="Avaab Razzaq" />
48+
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
49+
4750
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
48-
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
51+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
52+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
4953
<link rel="canonical" href={canonicalUrl} />
54+
<link rel="sitemap" href="/sitemap-index.xml" />
55+
<link rel="alternate" type="application/rss+xml" title="Avaab Razzaq Blog RSS Feed" href="/blog/rss.xml" />
5056
<link rel="preconnect" href="https://fonts.googleapis.com" />
5157
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
5258
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700;800&family=Sora:wght@300;400;600;700;800&display=swap" rel="stylesheet" />
@@ -58,6 +64,10 @@ const shouldLoadAnalytics = import.meta.env.PROD && gaMeasurementId.length > 0;
5864
<meta property="og:url" content={canonicalUrl} />
5965
<meta property="og:image" content={ogImage} />
6066
<meta property="og:image:alt" content={pageTitle} />
67+
<meta property="og:image:width" content="1200" />
68+
<meta property="og:image:height" content="630" />
69+
<meta property="og:site_name" content="Avaab Razzaq - AI Growth Engineer" />
70+
<meta property="og:locale" content="en_US" />
6171

6272
<meta name="twitter:card" content="summary_large_image" />
6373
<meta name="twitter:title" content={pageTitle} />

0 commit comments

Comments
 (0)