atinux / content-wind

A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
https://content-wind.nuxt.space
MIT License
791 stars 55 forks source link

feat: use experimental `nuxt.schema` to define app config #36

Closed pi0 closed 1 year ago

pi0 commented 1 year ago

Use experimental nuxt-config-schema to define app config from nuxt.schema.ts. This way we can annotate documentation and have custom resolvers for appConfig.

input:

export default defineNuxtConfigSchema({
  appConfig: {
    cover: '/cover.jpg',
    socials: {
      /** Twitter handle */
      twitter: '',
      /** Github repository name */
      github: '',
    }
  }
})

output: (.nuxt/schema/nuxt.schema.d.ts)

export interface NuxtUserConfig {
   appConfig: {
    /** @default "/cover.jpg" */
    cover: string,

    socials: {
       /**
        * Twitter handle
        * @default ""
       */
       twitter: string,

       /**
        * Github repository name
        * @default ""
       */
       github: string,
    },
  },
}
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
content-wind ✅ Ready (Inspect) Visit Preview Nov 29, 2022 at 4:11PM (UTC)
atinux commented 1 year ago

Closing sice implemented in latest commits, thanks!