// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({

  modules: [
    '@nuxt/eslint',
    '@nuxt/image',
    '@nuxt/ui-pro',
    '@nuxt/content',
    'nuxt-og-image',
    '@nuxt/fonts',
    'nuxt-llms'
  ],

  devtools: {
    enabled: true
  },
  css: ['~/assets/css/main.css'],

  content: {
    build: {
      markdown: {
        toc: {
          searchDepth: 2
        },
        highlight: {
          langs:
            ['js', 'ts', 'jsx', 'tsx', 'js', 'json', 'bash', 'python', 'html', 'css', 'sql',
              'yaml', 'md', 'sh', 'go', 'java', 'c', 'cpp', 'php', 'ruby', 'swift', 'html'],
          theme: {
            // Default theme (same as single string)
            default: 'github-dark',
            // Theme used if `html.dark`
            dark: 'github-dark',
            // Theme used if `html.sepia`
            sepia: 'monokai'
          }
        }
      },
      pathMeta: {
        slugifyOptions: {
          // Keep everything except invalid chars, this will preserve Chinese characters
          remove: /[$*+~()'"!\-=#?:@.]/g
        }
      }
    }
  },
  routeRules: {
    '/': { static: true },
    '/docs/**': { ssr: false },
    '/blog/**': { ssr: false },
    '/raw/**': { ssr: false }
  },

  compatibilityDate: '2024-07-11',

  nitro: {
    prerender: {
      routes: ['/'],
      crawlLinks: true,
      failOnError: false,
      autoSubfolderIndex: false
    }
  },

  eslint: {
    config: {
      stylistic: {
        commaDangle: 'never',
        braceStyle: '1tbs'
      }
    }
  },
  fonts: {
    defaults: {
      weights: ['300 800']
    }
  },

  icon: {
    clientBundle: {
      scan: true,
      sizeLimitKb: 512
    }
  },
  llms: {
    domain: 'https://lijue.me',
    title: 'Estel Docs',
    description: 'Estel Docs 文档系统',
    sections: [
      {
        title: 'Estel Docs',
        description: 'Estel Docs 文档系统',
        contentCollection: 'docs'
      }
    ]
  }
})
