forked from apisyouwonthate/openapi.tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
48 lines (47 loc) · 1.51 KB
/
astro.config.mjs
File metadata and controls
48 lines (47 loc) · 1.51 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
import netlify from '@astrojs/netlify';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'astro/config';
// https://astro.build/config
export default defineConfig({
vite: {
plugins: [tailwindcss()],
},
integrations: [
sitemap({
lastmod: new Date(),
serialize(item) {
// Homepage gets highest priority
if (item.url === 'https://openapi.tools/') {
return { ...item, priority: 1.0, changefreq: 'daily' };
}
// Categories and collections get high priority
if (
item.url.includes('/categories/') ||
item.url.includes('/collections/')
) {
return { ...item, priority: 0.8, changefreq: 'weekly' };
}
// Tools index gets high priority
if (item.url === 'https://openapi.tools/tools') {
return { ...item, priority: 0.8, changefreq: 'weekly' };
}
// Individual tool pages
if (item.url.includes('/tools/')) {
return { ...item, priority: 0.6, changefreq: 'monthly' };
}
// Static pages (sponsor, contributing, legacy)
return { ...item, priority: 0.5, changefreq: 'monthly' };
},
}),
react({
experimentalReactChildren: true,
}),
],
// @see hosting with netlify https://docs.astro.build/en/guides/integrations-guide/netlify/
output: 'static',
adapter: netlify(),
site: 'https://openapi.tools',
trailingSlash: 'never',
});