import { defineConfig, passthroughImageService } from 'astro/config';
import sitemap from '@astrojs/sitemap';

const site = process.env.ASTRO_SITE_URL || 'https://clawdie.si';
const outDir = process.env.ASTRO_OUT_DIR || './dist';

export default defineConfig({
  site,
  outDir,
  output: 'static',
  trailingSlash: 'always',
  image: {
    service: passthroughImageService(),
  },
  i18n: {
    defaultLocale: 'en',
    locales: ['en', 'sl'],
    routing: { prefixDefaultLocale: true, redirectToDefaultLocale: false },
  },
  integrations: [
    sitemap({
      i18n: {
        defaultLocale: 'en',
        locales: { en: 'en', sl: 'sl' },
      },
    }),
  ],
});
