-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.ts
More file actions
171 lines (168 loc) · 4.41 KB
/
astro.config.ts
File metadata and controls
171 lines (168 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import mdx from "@astrojs/mdx";
import partytown from "@astrojs/partytown";
import sitemap from "@astrojs/sitemap";
import solid from "@astrojs/solid-js";
import rehypeD2 from "@beoe/rehype-d2";
import tailwindcss from "@tailwindcss/vite";
import AstroPWA from "@vite-pwa/astro";
import { defineConfig } from "astro/config";
import rehypeCopyCodeButton from "./src/lib/rehypeCopyCodeButton";
// https://astro.build/config
export default defineConfig({
output: "static",
site: "https://avaabrazzaq.com", // Used to generate canonical URLs and sitemap entries.
trailingSlash: "always", // Consistent URL format - all URLs end with /
markdown: {
syntaxHighlight: {
type: "shiki",
excludeLangs: ["math", "d2"],
},
rehypePlugins: [
[
rehypeD2,
{
theme: 0,
darkTheme: 200,
sketch: false,
},
],
rehypeCopyCodeButton,
],
},
vite: {
plugins: [tailwindcss()],
},
integrations: [
solid(),
mdx({
rehypePlugins: [
[
rehypeD2,
{
theme: 0,
darkTheme: 200,
sketch: false,
},
],
rehypeCopyCodeButton,
],
}),
partytown({
config: {
forward: ["dataLayer.push"],
},
}),
sitemap({
serialize(item) {
// Enhanced sitemap with priority and changefreq
const url = item.url;
let priority = 0.5;
let changefreq = "monthly";
const lastmod = item.lastmod ?? new Date().toISOString();
// Homepage gets highest priority
if (url === "https://avaabrazzaq.com/") {
priority = 1.0;
changefreq = "weekly";
}
// Blog posts - high priority, updated occasionally
else if (url.includes("/blog/") && !url.endsWith("/blog/")) {
priority = 0.8;
changefreq = "monthly";
}
// Blog index
else if (url.endsWith("/blog/")) {
priority = 0.9;
changefreq = "weekly";
}
// Service pages - high priority
else if (url.includes("/services/") && !url.endsWith("/services/")) {
priority = 0.8;
changefreq = "monthly";
}
// Services index
else if (url.endsWith("/services/")) {
priority = 0.9;
changefreq = "monthly";
}
// Portfolio items
else if (url.includes("/portfolio/") && !url.endsWith("/portfolio/")) {
priority = 0.7;
changefreq = "yearly";
}
// Portfolio index
else if (url.endsWith("/portfolio/")) {
priority = 0.8;
changefreq = "monthly";
}
// About and contact
else if (url.includes("/about/") || url.includes("/contact/")) {
priority = 0.7;
changefreq = "monthly";
}
return {
...item,
changefreq: changefreq as typeof item.changefreq,
lastmod,
priority,
};
},
}),
AstroPWA({
registerType: "autoUpdate",
includeAssets: ["favicon.ico", "apple-touch-icon.png"],
manifest: {
name: "Avaab Razzaq",
short_name: "AR10",
theme_color: "#000000",
background_color: "#000000",
display: "standalone",
start_url: "/",
icons: [
{
src: "/pwa-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "any",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
workbox: {
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg)$/,
handler: "StaleWhileRevalidate",
options: {
cacheName: "images",
expiration: {
maxEntries: 20,
},
},
},
{
urlPattern: /\.(?:woff|woff2|ttf|eot)$/,
handler: "CacheFirst",
options: {
cacheName: "fonts",
expiration: {
maxEntries: 20,
maxAgeSeconds: 7 * 24 * 60 * 60,
},
},
},
],
},
}),
],
});