-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathastro.config.mjs
More file actions
67 lines (58 loc) · 1.7 KB
/
Copy pathastro.config.mjs
File metadata and controls
67 lines (58 loc) · 1.7 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
import { unified } from '@astrojs/markdown-remark'
import mdx from '@astrojs/mdx'
import preact from '@astrojs/preact'
import sitemap from '@astrojs/sitemap'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'astro/config'
import astroExpressiveCode from 'astro-expressive-code'
import { SITE_URL } from './src/consts'
import { getLegacyPostRedirections } from './src/utils/301'
/** @type {import('astro-expressive-code').AstroExpressiveCodeOptions} */
const astroExpressiveCodeOptions = {
site: 'https://www.maxpou.fr',
themes: ['material-theme-palenight'],
styleOverrides: {
textMarkers: {
markBorderColor: '#ffdc4e',
},
},
}
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
// Preserve Astro <=6 whitespace handling (v7 changed the default to 'jsx')
compressHTML: true,
// Astro 7 defaults to the Sätteri processor, which ignores remark/rehype
// plugins. astro-expressive-code injects a rehype plugin for code blocks, so
// we opt back into the unified() pipeline to keep code-block rendering.
markdown: {
processor: unified(),
},
redirects: {
'/blog/pages/1': '/blog',
'/portfolio': '/projects',
...getLegacyPostRedirections(),
},
integrations: [
astroExpressiveCode(astroExpressiveCodeOptions),
mdx(),
sitemap({
changefreq: 'weekly',
priority: 0.7,
lastmod: new Date(),
}),
preact(),
],
// Add security headers
server: {
headers: {
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'X-XSS-Protection': '1; mode=block',
'Referrer-Policy': 'strict-origin-when-cross-origin',
},
},
vite: {
plugins: [tailwindcss()],
},
})