import tailwindcss from "@tailwindcss/vite";

const description = 'I am a Research Fellow at the University of Padova working on music stuff and highly-interactive tech, but I also do other things.';

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
    app: {
        head: {
            htmlAttrs: {
                lang: 'en',
            },
            noscript: [
                { innerHTML: `<div class="noscript">
                        <center>Hi.</center>
                        First of all: I am <strong>genuinely</strong> interested to know why you disabled JavaScript
                        so <a href="mailto:andrea.franceschini@gmail.com">please send me an e-mail</a> — no judgement.<br />
                        Second: yes, I hate it too, but in this day and age JavaScript is kinda ubiquitous so I caved in.
                        I am still making an effort but this site may look a bit weird and hardly usable without JS. Sorry…
                    <noscript><p><img src="https://merida.morpheu5.net/balmyogre?idsite=1&amp;rec=1" style="border:0;" alt="" /></p></noscript>
                    </div>`
                },
            ],
            meta: [
                { charset: 'utf-8' },
                { property: 'author', content: 'Andrea Franceschini' },
                { property: 'description', content: description },
                { property: 'DC.Creator', content: 'Andrea Franceschini' },
                { property: 'DC.Description', content: description },
                { property: 'DC.Rights', content: 'CC BY-NC-SA 4.0' },

                { property: 'twitter:site', content: '@morpheu5' },
                { property: 'twitter:creator', content: '@morpheu5' },
                { property: 'twitter:description', content: description },
                { property: 'twitter:card', content: 'summary_large_image' },
                { property: 'twitter:image:src', content: 'https://andreafranceschini.org/images/colopic.jpg' },
                { property: 'twitter:domain', content: 'https://andreafranceschini.org' },

                { property: 'og:type', content: 'website' },
                { property: 'og:image', content: 'https://andreafranceschini.org/images/colopic.jpg' },
                { property: 'og:description', content: description },

                { property: 'robots', content: 'All' },
            ],
            link: [
                { rel: 'icon', type: 'image/svg+xml', href: '/images/favicon.svg' },
                { rel: 'icon', type: 'image/png', href: '/images/favicon.png' }
            ]
        },
    },
    compatibilityDate: '2025-07-15',
    devtools: { enabled: false },
    sourcemap: process.dev || false,
    components: true,
    telemetry: false,
    ssr: true,
    css: [
        "~/assets/css/main.css",
        '@fortawesome/fontawesome-svg-core/styles.css',
    ],
    modules: [
        ['@nuxtjs/google-fonts', {
            families: {
                "Oswald": {
                    wght: [400, 600],
                },
                "Open Sans": {
                    wght: [400, 700],
                },
            },
            subsets: ['latin', 'greek'],
            download: true,
        }],
        '@pinia/nuxt',
        'pinia-plugin-persistedstate/nuxt',
        '@vesp/nuxt-fontawesome',
    ],
    vite: {
        plugins: [
            tailwindcss(),
        ],
        css: {
            preprocessorOptions: {
                scss: {
                    additionalData: `@import "~/assets/css/main.css";`,
                }
            }
        },
    },
    postcss: {
        plugins: {
            '@tailwindcss/postcss': {},
            'postcss-import': {},
            'postcss-nested': {},
            'postcss-custom-media': {},
            'autoprefixer': {},

            // 'postcss-mixins': {},
            // 'postcss-preset-env': {},
            // 'cssnano': {},
        },
    },

})
