Repository navigation
Expand file tree
/
Copy pathastro.config.mjs
More file actions
117 lines (102 loc) · 2.93 KB
/
Copy pathastro.config.mjs
File metadata and controls
117 lines (102 loc) · 2.93 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
import { unified } from "@astrojs/markdown-remark";
import { defineConfig, fontProviders } from "astro/config";
import mdx from "@astrojs/mdx";
import vercel from "@astrojs/vercel";
import tailwindcss from "@tailwindcss/vite";
import icon from "astro-icon";
import { rehypeAccessibleEmojis } from "rehype-accessible-emojis";
import rehypeFigureTitle from "rehype-figure-title";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import customSitemap from "./src/plugins/custom-sitemap.mjs";
import { rehypeLocalizedFootnotes } from "./src/plugins/rehype-localized-footnotes.mjs";
import { remarkModifiedTime } from "./src/plugins/remark-modified-time.mjs";
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs";
import rehypeKatex from "rehype-katex";
import { DEFAULT_LOCALE_SETTING, LOCALES_SETTING } from "./src/locales";
// Oldest date for lastmod of all website
const minDate = new Date("2025-11-17");
const siteUrl =
process.env.VERCEL_ENV === "production"
? "https://blog.pablopl.dev"
: process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: "http://localhost:4321";
// https://astro.build/config
export default defineConfig({
site: siteUrl,
trailingSlash: "never",
image: {
layout: "constrained",
responsiveStyles: true,
breakpoints: [320, 480, 640, 750, 828, 1080, 1280, 1668, 1920, 2048],
},
build: {
inlineStylesheets: "always",
},
i18n: {
defaultLocale: DEFAULT_LOCALE_SETTING,
locales: Object.keys(LOCALES_SETTING),
routing: {
prefixDefaultLocale: true,
redirectToDefaultLocale: false,
},
},
integrations: [mdx(), customSitemap(siteUrl, "dist", minDate), icon()],
vite: {
plugins: [tailwindcss()],
},
markdown: {
processor: unified({
remarkPlugins: [
remarkMath,
remarkGfm,
remarkReadingTime,
remarkModifiedTime,
],
rehypePlugins: [
rehypeKatex,
rehypeFigureTitle,
rehypeAccessibleEmojis,
rehypeLocalizedFootnotes,
],
}),
},
adapter: vercel({
webAnalytics: {
enabled: true,
},
}),
fonts: [
{
provider: fontProviders.fontsource(),
name: "Rubik",
cssVariable: "--font-rubik",
weights: ["300 900"],
styles: ["normal", "italic"],
subsets: ["latin"],
fallbacks: ["system-ui", "sans-serif"],
display: "swap",
},
{
provider: fontProviders.fontsource(),
name: "Merriweather",
cssVariable: "--font-merriweather",
fallbacks: ["Georgia", "serif"],
weights: ["700"],
styles: ["normal"],
subsets: ["latin"],
display: "swap",
},
{
provider: fontProviders.fontsource(),
name: "Cascadia Code",
cssVariable: "--font-cascadia",
fallbacks: ["ui-monospace", "monospace"],
weights: ["200 700"],
styles: ["normal"],
subsets: ["latin"],
display: "swap",
},
],
});