From c21eb32c7086b4e023ae5e313d8795ef91b805ac Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 2 Apr 2025 12:20:26 +0200 Subject: [PATCH] docs: add team page --- docs/app/components/Footer.vue | 4 +- docs/app/pages/.index.yml | 6 +- docs/app/pages/index.vue | 13 +-- docs/app/pages/team.vue | 151 +++++++++++++++++++++++++++++ docs/server/api/module.json.get.ts | 34 +++++++ 5 files changed, 193 insertions(+), 15 deletions(-) create mode 100644 docs/app/pages/team.vue create mode 100644 docs/server/api/module.json.get.ts diff --git a/docs/app/components/Footer.vue b/docs/app/components/Footer.vue index b5bab47a..d079043c 100644 --- a/docs/app/components/Footer.vue +++ b/docs/app/components/Footer.vue @@ -2,8 +2,8 @@ const route = useRoute() const links = [{ - label: 'Figma', - to: '/figma' + label: 'Team', + to: '/team' }, { label: 'Roadmap', to: '/roadmap' diff --git a/docs/app/pages/.index.yml b/docs/app/pages/.index.yml index e19155d1..d0bb2617 100644 --- a/docs/app/pages/.index.yml +++ b/docs/app/pages/.index.yml @@ -176,7 +176,11 @@ community: links: - label: Star on GitHub color: neutral - variant: outline to: https://github.com/nuxt/ui target: _blank icon: i-lucide-star + - label: Meet the team + color: neutral + variant: outline + to: /team + trailingIcon: i-lucide-arrow-right diff --git a/docs/app/pages/index.vue b/docs/app/pages/index.vue index 60738b00..1833be70 100644 --- a/docs/app/pages/index.vue +++ b/docs/app/pages/index.vue @@ -23,18 +23,7 @@ const { data: components } = await useAsyncData('ui-components', () => { .all() }) -const { data: module } = await useFetch<{ - stats: { - downloads: number - stars: number - } - contributors: { - username: string - }[] -}>('https://api.nuxt.com/modules/ui', { - key: 'stats', - transform: ({ stats, contributors }) => ({ stats, contributors }) -}) +const { data: module } = await useFetch('/api/module.json') const { format } = Intl.NumberFormat('en', { notation: 'compact' }) diff --git a/docs/app/pages/team.vue b/docs/app/pages/team.vue new file mode 100644 index 00000000..7eadc860 --- /dev/null +++ b/docs/app/pages/team.vue @@ -0,0 +1,151 @@ + + + diff --git a/docs/server/api/module.json.get.ts b/docs/server/api/module.json.get.ts new file mode 100644 index 00000000..cb5cdf7f --- /dev/null +++ b/docs/server/api/module.json.get.ts @@ -0,0 +1,34 @@ +interface TeamMember { + name: string + login: string + avatarUrl: string + pronouns?: string + location?: string + websiteUrl?: string + sponsorsListing?: string + socialAccounts: Record +} + +interface Module { + stats: { + downloads: number + stars: number + } + contributors: { + username: string + }[] +} +export default defineCachedEventHandler(async () => { + const team = await $fetch('https://api.nuxt.com/teams/ui') + const { stats, contributors } = await $fetch('https://api.nuxt.com/modules/ui') + + return { + team, + stats, + contributors + } +}, { + maxAge: 60 * 60, // 1 hour + shouldBypassCache: () => !!import.meta.dev, + getKey: () => 'module' +})