-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
45 lines (44 loc) · 1.67 KB
/
Copy pathastro.config.mjs
File metadata and controls
45 lines (44 loc) · 1.67 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
// Astro configuration for the FBIde marketing site.
// Static-only build, no client JS frameworks. Bootstrap 5 is loaded via
// CDN from each page's head — see src/layouts/BaseLayout.astro.
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://fbide.freebasic.net',
// Switch to 'directory' if hosting wants pretty URLs (download/index.html
// instead of download.html). Default 'file' keeps things flat for static
// hosts.
build: {
format: 'file'
},
vite: {
css: {
preprocessorOptions: {
scss: {
// Bootstrap 5.3 is still written against the legacy Sass
// module system; silence its deprecation noise so real
// warnings stay visible in the build log.
silenceDeprecations: [
'import', 'global-builtin', 'color-functions',
'if-function',
],
},
},
},
},
integrations: [
// build.format: 'file' produces /foo.html on disk — append the
// extension to non-root sitemap entries so search engines hit the
// real URLs instead of 404ing on a directory-style /foo.
sitemap({
serialize(item) {
const url = new URL(item.url);
if (url.pathname !== '/' && !url.pathname.endsWith('.html')) {
url.pathname = `${url.pathname.replace(/\/$/, '')}.html`;
item.url = url.toString();
}
return item;
},
}),
]
});