-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
103 lines (98 loc) · 2.92 KB
/
astro.config.mjs
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
import { defineConfig } from "astro/config";
import svelte from "@astrojs/svelte";
// import compress from "astro-compress";
import sitemap from "@astrojs/sitemap";
import robotsTxt from "astro-robots-txt";
import astroI18next from "astro-i18next";
// const target = "docs";
// https://astro.build/config
// legacy: { // this may be required for ESM import to work in regular markdown
// astroFlavoredMarkdown: true,
// },
import mdx from "@astrojs/mdx";
import image from "@astrojs/image";
// https://astro.build/config
export default defineConfig({
site: "https://rccalmaty.com",
// base: '/docs',
// outDir: target,
publicDir: "src/public",
// trailingSlash: "never",
server: {
port: 8081
},
build: {
format: "file"
},
experimental: {
integrations: true // required for compress and robotsTxt
},
integrations: [
svelte(),
astroI18next({
baseLanguage: "ru",
i18next: {
debug: true,
// convenient during development to check for missing keys
// ns: ["common", "forms"],
defaultNS: "common",
// translation keys will be retrieved in the common.json file by default
supportedLngs: ["ru", "kk", "en"],
resourcesPath: "src/locales" // resourcesPath ?string (src/resources/locales/) The path to your translation files
}
}),
// compress({
// // path: target,
// // logger: 0, // default 2
// css: false // html: false,
// // js: false,
// // img: false,
// // svg: false
// }),
robotsTxt({
sitemapBaseFileName: "sitemap-index",
// default 'sitemap-index'
policy: [
// https://github.com/alextim/astro-lib/tree/main/packages/astro-robots-txt#readme
{
userAgent: "*",
allow: "/",
crawlDelay: 10,
// cleanParam: "ref /articles/",
disallow: ["/assets/"]
}
]
}),
sitemap({
// https://docs.astro.build/en/guides/integrations-guide/sitemap/
serialize(item) {
if (/^https\:\/\/rccalmaty\.com\/ru\/SKIP\/$/.test(item.url)) {
console.warn(" ! [SKIP] Skipped in sitemap:", item.url);
return undefined;
}
if (/^https\:\/\/rccalmaty\.com\/.*\/$/.test(item.url)) {
// ends with slash, but must end in .html
item.url = item.url.substr(0, item.url.length - 1) + ".html";
} // console.log(item.url);
return item;
},
i18n: {
entryLimit: 10000,
changefreq: "weekly",
priority: 0.7,
// lastmod: new Date("2022-02-24"),
defaultLocale: "ru",
// All urls that don't contain `es` or `fr` after `site` will be treated as default locale, i.e. `en`
locales: {
ru: "ru-RU",
kz: "kk-KZ",
en: "en-US"
// The `defaultLocale` value must present in `locales` keys
}
}
}),
mdx(),
image()
],
output: "static"
});