diff --git a/docs/app/components/Header.vue b/docs/app/components/Header.vue index 81494e9b..4aebac36 100644 --- a/docs/app/components/Header.vue +++ b/docs/app/components/Header.vue @@ -22,8 +22,20 @@ onMounted(() => { const navigation = inject>('navigation') +const githubLink = computed(() => { + return `https://github.com/nuxt/${value.value}` +}) + const desktopLinks = computed(() => props.links.map(({ icon, ...link }) => link)) -const mobileLinks = computed(() => props.links.map(link => ({ ...link, defaultOpen: link.children && route.path.startsWith(link.to as string) }))) +const mobileLinks = computed(() => [ + ...props.links.map(link => ({ ...link, defaultOpen: link.children && route.path.startsWith(link.to as string) })), + { + label: 'Open on GitHub', + to: githubLink.value, + icon: 'i-simple-icons-github', + target: '_blank' + } +]) diff --git a/docs/content/3.components/radio-group.md b/docs/content/3.components/radio-group.md index 391e9511..29328c64 100644 --- a/docs/content/3.components/radio-group.md +++ b/docs/content/3.components/radio-group.md @@ -17,7 +17,7 @@ Use the `v-model` directive to control the value of the RadioGroup or the `defau ### Items -Use the `items` prop as an array of strings, numbers or booleans: +Use the `items` prop as an array of strings or numbers: ::component-code --- diff --git a/docs/content/showcase.yml b/docs/content/showcase.yml index a55a9850..3aa1ab91 100644 --- a/docs/content/showcase.yml +++ b/docs/content/showcase.yml @@ -5,16 +5,31 @@ hero: title: Showcase description: Discover our selection of projects built with Nuxt UI. items: + - name: Ovatu + url: https://ovatu.com/ - name: Shelve url: https://shelve.cloud github: https://github.com/hugorcd/shelve - name: Uneed - url: https://uneed.best + url: https://uneed.best/ - name: Details - url: https://details.team + url: https://details.team/ - name: Espace Asso by Benevolt - url: https://asso.benevolt.fr + url: https://asso.benevolt.fr/ - name: Directus Docs - url: https://docs.directus.io + url: https://docs.directus.io/ - name: Super SaaS url: https://supersaas.dev/ + - name: Passionate People + url: https://passionatepeople.io/ + - name: The Companies API + url: https://www.thecompaniesapi.com/ + - name: Thuprai + url: https://thuprai.com/ + - name: Juno.one + url: https://www.juno.one/ + - name: Pallyy + url: https://pallyy.com/ + url: https://supersaas.dev + - name: CareerDeck + url: https://careerdeck.ai diff --git a/docs/modules/screenshot.ts b/docs/modules/screenshot.ts deleted file mode 100644 index 545cf1d6..00000000 --- a/docs/modules/screenshot.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { defineNuxtModule } from '@nuxt/kit' -import { existsSync } from 'node:fs' -import { join } from 'pathe' -import captureWebsite from 'capture-website' - -interface ContentFile { - id?: string - items?: any -} - -interface TemplateItem { - name: string - url?: string - screenshotUrl?: string - screenshotOptions?: Record -} - -export default defineNuxtModule((options, nuxt) => { - nuxt.hook('content:file:afterParse', async ({ content: file }: { content: ContentFile }) => { - if (file.id?.includes('showcase') && file.items) { - const itemsArray: TemplateItem[] = Array.isArray(file.items) - ? file.items - : Object.values(file.items) - if (itemsArray.length === 0) { - console.log('No items to process') - return - } - console.log(`Processing ${itemsArray.length} template items`) - for (const template of itemsArray) { - const url = template.screenshotUrl || template.url - if (!url) { - console.error(`Template ${template.name} has no "url" or "screenshotUrl" to take a screenshot from`) - continue - } - const name = template.name.toLowerCase().replace(/\s/g, '-') - const filename = join(process.cwd(), 'docs/public/assets/showcase', `${name}.png`) - if (existsSync(filename)) { - console.log(`Screenshot for ${template.name} already exists, skipping`) - continue - } - console.log(`Generating screenshot for Template ${template.name} hitting ${url}...`) - try { - await captureWebsite.file(url, filename, { - ...(template.screenshotOptions || {}), - launchOptions: { headless: true } - }) - console.log(`Screenshot for ${template.name} generated successfully`) - } catch (error) { - console.error(`Error generating screenshot for ${template.name}:`, error) - } - } - } - }) -}) diff --git a/docs/modules/showcase.ts b/docs/modules/showcase.ts new file mode 100644 index 00000000..3486c908 --- /dev/null +++ b/docs/modules/showcase.ts @@ -0,0 +1,56 @@ +import { defineNuxtModule } from '@nuxt/kit' +import { existsSync } from 'node:fs' +import { join } from 'pathe' +import captureWebsite from 'capture-website' + +interface ContentFile { + id?: string + body?: { + items: TemplateItem[] + } +} + +interface TemplateItem { + name: string + url?: string + screenshotUrl?: string + screenshotOptions?: Record +} + +export default defineNuxtModule((_, nuxt) => { + nuxt.hook('content:file:afterParse', async ({ content: file }: { content: ContentFile }) => { + if (!file.id?.includes('showcase')) { + return + } + if (!file.body?.items?.length) { + return + } + for (const template of file.body.items) { + const url = template.screenshotUrl || template.url + if (!url) { + console.error(`Template ${template.name} has no "url" or "screenshotUrl" to take a screenshot from`) + continue + } + + const name = template.name.toLowerCase().replace(/\s/g, '-') + const filename = join(process.cwd(), 'docs/public/assets/showcase', `${name}.png`) + + if (existsSync(filename)) { + continue + } + + console.log(`Generating screenshot for Template ${template.name} hitting ${url}...`) + + try { + await captureWebsite.file(url, filename, { + ...(template.screenshotOptions || {}), + launchOptions: { headless: true } + }) + + console.log(`Screenshot for ${template.name} generated successfully`) + } catch (error) { + console.error(`Error generating screenshot for ${template.name}:`, error) + } + } + }) +}) diff --git a/docs/public/assets/showcase/juno.one.png b/docs/public/assets/showcase/juno.one.png new file mode 100644 index 00000000..01904649 Binary files /dev/null and b/docs/public/assets/showcase/juno.one.png differ diff --git a/docs/public/assets/showcase/ovatu.png b/docs/public/assets/showcase/ovatu.png new file mode 100644 index 00000000..6dc1d0cc Binary files /dev/null and b/docs/public/assets/showcase/ovatu.png differ diff --git a/docs/public/assets/showcase/pallyy.png b/docs/public/assets/showcase/pallyy.png new file mode 100644 index 00000000..4733ddd7 Binary files /dev/null and b/docs/public/assets/showcase/pallyy.png differ diff --git a/docs/public/assets/showcase/passionate-people.png b/docs/public/assets/showcase/passionate-people.png new file mode 100644 index 00000000..12cf1be0 Binary files /dev/null and b/docs/public/assets/showcase/passionate-people.png differ diff --git a/docs/public/assets/showcase/the-companies-api.png b/docs/public/assets/showcase/the-companies-api.png new file mode 100644 index 00000000..ebce2a29 Binary files /dev/null and b/docs/public/assets/showcase/the-companies-api.png differ diff --git a/docs/public/assets/showcase/thuprai.png b/docs/public/assets/showcase/thuprai.png new file mode 100644 index 00000000..2c79f9ac Binary files /dev/null and b/docs/public/assets/showcase/thuprai.png differ