From a9339ccf2a7f897a795b1c10123734895cf0b55c Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 25 Sep 2024 12:18:02 +0200 Subject: [PATCH] docs: remove `/dev` switch --- docs/app.vue | 23 +----- docs/components/Banner.vue | 4 +- docs/components/BranchSelect.vue | 34 --------- docs/components/Header.vue | 15 ++-- docs/components/LogoPro.vue | 14 ++++ .../examples/HorizontalNavigationExample.vue | 4 +- ...HorizontalNavigationExampleDefaultSlot.vue | 4 +- .../HorizontalNavigationExampleSections.vue | 4 +- .../examples/VerticalNavigationExample.vue | 4 +- .../VerticalNavigationExampleSections.vue | 4 +- docs/composables/useContentSource.ts | 76 ------------------- docs/error.vue | 21 +---- docs/layouts/docs.vue | 2 - docs/nuxt.config.ts | 24 ++---- docs/pages/[...slug].vue | 6 +- docs/pages/index.vue | 2 +- docs/pages/releases.vue | 2 +- vercel.json | 5 ++ 18 files changed, 53 insertions(+), 195 deletions(-) delete mode 100644 docs/components/BranchSelect.vue create mode 100644 docs/components/LogoPro.vue delete mode 100644 docs/composables/useContentSource.ts diff --git a/docs/app.vue b/docs/app.vue index bdb7512c..f4c7e6eb 100644 --- a/docs/app.vue +++ b/docs/app.vue @@ -3,7 +3,7 @@
- +
@@ -36,35 +36,20 @@ const searchRef = ref() const route = useRoute() const colorMode = useColorMode() -const { branch } = useContentSource() -const { data: nav } = await useAsyncData('navigation', () => fetchContentNavigation()) +const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation()) const { data: files } = useLazyFetch('/api/search.json', { default: () => [], server: false }) // Computed -const navigation = computed(() => { - if (branch.value?.name === 'dev') { - const dev = nav.value.find(item => item._path === '/dev')?.children - const pro = nav.value.find(item => item._path === '/pro') - - return [ - ...dev, - ...(pro ? [pro] : []) - ] - } - - return nav.value?.filter(item => item._path !== '/dev') || [] -}) - const color = computed(() => colorMode.value === 'dark' ? '#18181b' : 'white') const links = computed(() => { return [{ label: 'Docs', icon: 'i-heroicons-book-open', - to: branch.value?.name === 'dev' ? '/dev/getting-started' : '/getting-started', - active: branch.value?.name === 'dev' ? (route.path.startsWith('/dev/getting-started') || route.path.startsWith('/dev/components')) : (route.path.startsWith('/getting-started') || route.path.startsWith('/components')) + to: '/getting-started', + active: route.path.startsWith('/getting-started') || route.path.startsWith('/components') }, ...(navigation.value.find(item => item._path === '/pro') ? [{ label: 'Pro', icon: 'i-heroicons-square-3-stack-3d', diff --git a/docs/components/Banner.vue b/docs/components/Banner.vue index 86f08327..e26ec930 100644 --- a/docs/components/Banner.vue +++ b/docs/components/Banner.vue @@ -8,7 +8,7 @@ const hideBanner = () => { document.querySelector('html')?.classList.add('hide-banner') } -if (process.server) { +if (import.meta.server) { useHead({ script: [{ key: 'prehydrate-template-banner', @@ -32,7 +32,7 @@ if (process.server) {