-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate to Nuxt UI v3 & Content v3 (#471)
Co-authored-by: HugoRCD <[email protected]>
- Loading branch information
Showing
121 changed files
with
3,799 additions
and
4,125 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export default defineAppConfig({ | ||
ui: { | ||
colors: { | ||
primary: 'green', | ||
neutral: 'slate', | ||
warning: 'amber', | ||
important: 'violet' | ||
}, | ||
commandPalette: { | ||
slots: { | ||
itemLeadingIcon: 'size-4' | ||
} | ||
}, | ||
tabs: { | ||
slots: { | ||
list: 'overflow-x-auto' | ||
} | ||
} | ||
}, | ||
uiPro: { | ||
contentNavigation: { | ||
slots: { | ||
linkLeadingIcon: 'size-4', | ||
listWithChildren: 'ms-4.5' | ||
} | ||
} | ||
}, | ||
seo: { | ||
siteName: 'NuxtHub' | ||
}, | ||
toc: { | ||
title: 'On this page', | ||
bottom: { | ||
edit: 'https://github.com/nuxt-hub/core/edit/main/docs/content' | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import "tailwindcss"; | ||
@import "@nuxt/ui-pro"; | ||
|
||
@source "../../content/**/*"; | ||
|
||
.dark { | ||
/* --ui-bg: var(--ui-color-neutral-950); */ | ||
--ui-bg: rgb(2, 4, 32); | ||
} | ||
|
||
@theme { | ||
--font-sans: 'Public Sans', sans-serif; | ||
|
||
--breakpoint-3xl: 1920px; | ||
|
||
--color-green-50: #EFFDF5; | ||
--color-green-100: #D9FBE8; | ||
--color-green-200: #B3F5D1; | ||
--color-green-300: #75EDAE; | ||
--color-green-400: #00DC82; | ||
--color-green-500: #00C16A; | ||
--color-green-600: #00A155; | ||
--color-green-700: #007F45; | ||
--color-green-800: #016538; | ||
--color-green-900: #0A5331; | ||
--color-green-950: #052E16; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<script setup lang="ts"> | ||
import type { ContentNavigationItem } from '@nuxt/content' | ||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation') | ||
const route = useRoute() | ||
const links = computed(() => [ | ||
{ | ||
label: 'Docs', | ||
to: '/docs/getting-started', | ||
active: route.path.startsWith('/docs'), | ||
icon: 'i-lucide-book' | ||
}, { | ||
label: 'Templates', | ||
to: '/templates', | ||
icon: 'i-lucide-panels-top-left' | ||
}, { | ||
label: 'Pricing', | ||
to: '/pricing', | ||
icon: 'i-lucide-credit-card' | ||
}, { | ||
label: 'Changelog', | ||
to: '/changelog', | ||
icon: 'i-lucide-megaphone' | ||
}, { | ||
label: 'Blog', | ||
to: '/blog', | ||
icon: 'i-lucide-newspaper' | ||
} | ||
]) | ||
const navLinks = computed(() => links.value.map((link) => { | ||
if (link.label === 'Docs') { | ||
return { | ||
icon: link.icon, | ||
title: link.label, | ||
path: link.to, | ||
children: navigation.value | ||
} | ||
} | ||
return { | ||
title: link.label, | ||
path: link.to, | ||
icon: link.icon | ||
} | ||
})) | ||
const ready = ref(false) | ||
const authenticated = ref(false) | ||
onMounted(async () => { | ||
const endpoint = import.meta.dev ? 'http://localhost:3000/api/authenticated' : 'https://admin.hub.nuxt.com/api/authenticated' | ||
await $fetch(endpoint, { | ||
credentials: 'include' | ||
}).then((state: { authenticated: boolean }) => { | ||
authenticated.value = state.authenticated | ||
}).catch(() => { | ||
authenticated.value = false | ||
}) | ||
nextTick(() => { | ||
ready.value = true | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<UHeader> | ||
<template #left> | ||
<div class="inline-flex items-end gap-2"> | ||
<NuxtLink to="/" aria-label="NuxtHub"><HubLogo class="h-6" /></NuxtLink> | ||
<UBadge variant="subtle" size="sm" class="relative top-[2px]"> | ||
beta | ||
</UBadge> | ||
</div> | ||
</template> | ||
|
||
<UNavigationMenu :items="links.map(({ icon, ...link }) => link)" variant="link" :ui="{ link: 'text-(--ui-text-highlighted) hover:text-(--ui-primary) data-active:text-(--ui-primary)' }" /> | ||
|
||
<template #right> | ||
<div class="flex items-center gap-2 transition-opacity duration-300" :class="[ready ? 'opacity-100' : 'opacity-0']"> | ||
<UTooltip text="Search" :kbds="['meta', 'K']" :popper="{ strategy: 'absolute' }"> | ||
<UContentSearchButton :label="null" size="sm" /> | ||
</UTooltip> | ||
<UButton v-if="ready && !authenticated" size="sm" label="Log in" color="neutral" variant="subtle" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=login" class="hidden sm:inline-flex" external /> | ||
<UButton v-if="ready && !authenticated" size="sm" label="Sign up" color="neutral" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=signup" class="hidden sm:inline-flex" external /> | ||
<UButton v-if="ready && authenticated" size="sm" label="Dashboard" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=dashboard" class="hidden sm:inline-flex" external /> | ||
</div> | ||
</template> | ||
|
||
<template #body> | ||
<UContentNavigation :navigation="navLinks" highlight type="single" :default-open="$route.path.startsWith('/docs')" :ui="{ itemWithChildren: 'ps-1.5' }" /> | ||
|
||
<div class="flex flex-col gap-y-2 mt-4"> | ||
<USeparator class="mb-4" /> | ||
<UButton v-if="ready && !authenticated" label="Log in" color="neutral" variant="subtle" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=login" class="flex justify-center sm:hidden" external /> | ||
<UButton v-if="ready && !authenticated" label="Sign up" color="neutral" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=signup" class="flex justify-center text-gray-900 bg-(--ui-primary) sm:hidden" external /> | ||
<UButton v-if="ready && authenticated" label="Dashboard" to="https://admin.hub.nuxt.com/?utm_source=hub-docs&utm_medium=header&utm_campaign=dashboard" class="flex justify-center text-gray-900 bg-(--ui-primary) sm:hidden" external /> | ||
</div> | ||
</template> | ||
</UHeader> | ||
</template> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.