-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
89 lines (86 loc) · 2.37 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
// https://docs.astro.build/es/guides/deploy/render/#c%C3%B3mo-desplegar
// https://docs.astro.build/en/guides/configuring-astro/#environment-variables
import { loadEnv } from 'vite';
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import robotsTxt from 'astro-robots-txt';
import sitemap from '@astrojs/sitemap';
import react from "@astrojs/react";
import node from "@astrojs/node";
import vercel from "@astrojs/vercel/serverless";
const env = loadEnv(process.env.NODE_ENV, process.cwd(), '');
const baseUrl = env?.PUBLIC_BASE_URL || '';
// https://astro.build/config
export default defineConfig({
'devToolbar': {
'enabled': false
},
'site': baseUrl,
'trailingSlash': 'ignore',
// Because of form contact
//'output': 'server',
//'output': 'static',
'output': 'hybrid',
'adapter': node({
'mode': 'standalone'
}),
'adapter': vercel({
'edgeMiddleware': true,
'isr': true,
}),
'integrations': [
react(),
// https://docs.astro.build/en/guides/styling/#sass-and-scss
tailwind(),
sitemap(),
// https://www.npmjs.com/package/astro-robots-txt
robotsTxt({
'sitemap': true,
'sitemapBaseFileName': 'sitemap-index',
'policy': [{
'userAgent': '*',
'allow': '/',
'disallow': ['/admin', '/login'],
'crawlDelay': 2
}]
})
],
// https://docs.astro.build/en/guides/internationalization/
'i18n': {
'defaultLocale': 'es',
'locales': ['es', 'en'],
'fallback': {
'en': 'es'
},
'routing': {
'prefixDefaultLocale': false
}
},
'resolve': {
'alias': {
'bootstrap' : 'bootstrap/dist/js/bootstrap.bundle.js'
}
},
'build': {
'inlineStylesheets': 'never'
},
'redirects': {
// Redirection index
'/index.html': '/',
'/eng/index.html': '/en',
// Redirection about
'/nosotros.html': '/aboutus',
'/eng/aboutus.html': '/en/aboutus',
// Redirection projects
'/proyectos.html': '/projects',
'/eng/projects.html': '/en/projects',
'/proyectos/[...project]/[...slug].html': '/projects/[project]',
'/eng/proyectos/[...project]/[...slug].html': '/en/projects/[project]',
// Redirection services
'/servicios.html': '/services',
'/eng/services.html': '/en/services',
// Redirection contact
'/contacto.html': '/contact',
'/eng/contact.html': '/en/contact'
}
});