// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  extends: ['@yvv/nuxt-base'],
  compatibilityDate: '2025-07-15',

  devtools: { enabled: true },

  devServer: {
    port: 3000,
  },

  modules: [
    '@nuxt/content',
    '@pinia/nuxt',
    '@unocss/nuxt',
    '@vueuse/nuxt',
    '@nuxt/image',
    '@nuxtjs/sitemap',
    'nuxt-umami',
  ],

  umami: {
    host: 'https://stats.open.us.org',
    id: '95ff616d-9ce1-47d9-bca2-f6ddc344a99a',
    autoTrack: true,
    ignoreLocalhost: true,
  },

  site: {
    url: 'https://librodrome.org',
    name: 'Le Librodrome',
  },

  sitemap: {
    strictNuxtContentPaths: false,
    sources: ['/api/__sitemap__/urls'],
    urls: [
      { loc: '/', changefreq: 'weekly', priority: 1.0 },
      { loc: '/economique', changefreq: 'monthly', priority: 0.9 },
      { loc: '/economique/modele-eco', changefreq: 'monthly', priority: 0.9 },
      { loc: '/economique/monnaie-libre', changefreq: 'monthly', priority: 0.8 },
      { loc: '/economique/productions-collectives', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/commande', changefreq: 'monthly', priority: 0.8 },
      { loc: '/numerique', changefreq: 'monthly', priority: 0.8 },
      { loc: '/numerique/logiciel-libre', changefreq: 'monthly', priority: 0.8 },
      { loc: '/numerique/authentification-wot', changefreq: 'monthly', priority: 0.7 },
      { loc: '/numerique/cloud-libre', changefreq: 'monthly', priority: 0.7 },
      { loc: '/citoyenne', changefreq: 'monthly', priority: 0.8 },
      { loc: '/citoyenne/decision', changefreq: 'monthly', priority: 0.8 },
      { loc: '/citoyenne/tarifs-eau', changefreq: 'monthly', priority: 0.7 },
      { loc: '/en-musique', changefreq: 'monthly', priority: 0.8 },
      { loc: '/a-propos', changefreq: 'yearly', priority: 0.5 },
      // Chapitres modele-eco
      { loc: '/economique/modele-eco/01-introduction', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/02-don', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/03-mesure', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/04-monnaie', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/05-trm', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/06-produire', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/07-echanger', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/08-institution', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/09-greffes', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/10-maintenant', changefreq: 'monthly', priority: 0.7 },
      { loc: '/economique/modele-eco/11-annexes', changefreq: 'monthly', priority: 0.6 },
    ],
  },

  unocss: {
    safelist: [
      // Axis block icons (dynamic from YAML)
      'i-lucide-monitor', 'i-lucide-coins', 'i-lucide-landmark',
      'i-lucide-code-2', 'i-lucide-share-2', 'i-lucide-cloud',
      'i-lucide-scale', 'i-lucide-gavel', 'i-lucide-users',
      'i-lucide-droplets', 'i-lucide-calendar-heart',
      // Action icons
      'i-lucide-play', 'i-lucide-book-open', 'i-lucide-sparkles',
      'i-lucide-heart-handshake', 'i-lucide-arrow-up-right',
      'i-lucide-rocket', 'i-lucide-flask-conical', 'i-lucide-arrow-right',
      // Decision page
      'i-lucide-vote', 'i-lucide-scroll-text', 'i-lucide-git-branch',
      // sweethomeCloud + territoire
      'i-lucide-home', 'i-lucide-hard-drive', 'i-lucide-video',
      'i-lucide-message-circle', 'i-lucide-bot', 'i-lucide-globe-2',
      'i-lucide-map-pin', 'i-lucide-euro', 'i-lucide-package',
      'i-lucide-settings', 'i-lucide-layout-grid', 'i-lucide-server',
      'i-lucide-chevron-down', 'i-lucide-info',
    ],
  },

  app: {
    head: {
      htmlAttrs: { lang: 'fr' },
      link: [
        { rel: 'preconnect', href: 'https://fonts.bunny.net' },
        {
          rel: 'stylesheet',
          href: 'https://fonts.bunny.net/css?family=syne:400,500,600,700,800|space-grotesk:300,400,500,600,700|jetbrains-mono:400,500,700',
        },
      ],
      meta: [
        { name: 'color-scheme', content: 'dark' },
      ],
    },
    pageTransition: { name: 'page', mode: 'out-in' },
  },

  css: [
    '~/assets/css/main.css',
  ],

  runtimeConfig: {
    adminPassword: '',
    adminSecret: '',
    umamiApiKey: '',
    public: {
      siteUrl: 'https://librodrome.org',
      tenantId: 'librodrome',
      umamiUrl: '',
      umamiWebsiteId: '',
    },
  },

  nitro: {
    externals: {
      traceInclude: [
        'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs',
      ],
    },
  },

})
