- Replace default Astro favicon with minimal "CT" SVG (orange brand color) - Delete unused favicon.ico - Add carbon footprint disclosure to footer with Ecograder data (A+, 0,001 g CO₂/visita, 10,7 kB, 100% green hosting) - Add explicit "personal research project, not official" disclosure - Update site URL to casesbuides.itziarzameza.dev across astro.config.mjs and Base.astro fallback
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
// @ts-check
|
|
import { defineConfig } from 'astro/config';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import sitemap from '@astrojs/sitemap';
|
|
import node from '@astrojs/node';
|
|
|
|
// Vite plugin inline: añade Content-Type correcto para .pmtiles y .geojson
|
|
// en dev server. Sin esto, Astro/Vite sirve .pmtiles con Content-Type vacío
|
|
// y la librería pmtiles del cliente falla al parsear el header del archivo.
|
|
function assetMimePlugin() {
|
|
return {
|
|
name: 'cases-tancades-asset-mime',
|
|
configureServer(/** @type {any} */ server) {
|
|
// @ts-expect-error tipos de Vite no exportados
|
|
server.middlewares.use((_req, res, next) => {
|
|
const url = _req.url ?? '';
|
|
if (url.endsWith('.pmtiles')) {
|
|
res.setHeader('Content-Type', 'application/octet-stream');
|
|
} else if (url.endsWith('.geojson')) {
|
|
res.setHeader('Content-Type', 'application/geo+json');
|
|
} else if (url.endsWith('.json') && url.includes('/data/')) {
|
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
}
|
|
next();
|
|
});
|
|
},
|
|
};
|
|
}
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
site: 'https://casesbuides.itziarzameza.dev',
|
|
output: 'server',
|
|
adapter: node({ mode: 'standalone' }),
|
|
integrations: [sitemap()],
|
|
vite: {
|
|
plugins: [assetMimePlugin(), tailwindcss()],
|
|
},
|
|
});
|