|
1 | 1 | <script setup lang="ts"> |
| 2 | +import { useDocusI18n } from '#imports' |
| 3 | +
|
2 | 4 | const appConfig = useAppConfig() |
3 | | -const currentVersion = appConfig.versioning?.current || 'v3' |
4 | | -const isOldVersion = currentVersion !== 'v3' |
| 5 | +const site = useSiteConfig() |
| 6 | +
|
| 7 | +const { localePath, isEnabled, locales } = useDocusI18n() |
| 8 | +
|
| 9 | +const links = computed(() => appConfig.github && appConfig.github.url |
| 10 | + ? [ |
| 11 | + { |
| 12 | + 'icon': 'i-simple-icons-github', |
| 13 | + 'to': appConfig.github.url, |
| 14 | + 'target': '_blank', |
| 15 | + 'aria-label': 'GitHub', |
| 16 | + }, |
| 17 | + ] |
| 18 | + : []) |
| 19 | +
|
| 20 | +const currentVersion = computed(() => appConfig.versioning?.current || 'v3') |
| 21 | +const isOldVersion = computed(() => currentVersion.value !== 'v3') |
5 | 22 | </script> |
6 | 23 |
|
7 | 24 | <template> |
8 | | - <div> |
9 | | - <div |
10 | | - v-if="isOldVersion" |
11 | | - class="bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 px-4 py-2 text-center text-sm border-b border-amber-200 dark:border-amber-800" |
12 | | - > |
13 | | - You are viewing documentation for Flowforge {{ currentVersion }}. |
14 | | - <a |
15 | | - href="/flowforge/" |
16 | | - class="underline font-medium hover:text-amber-900 dark:hover:text-amber-100" |
17 | | - > |
18 | | - View the latest version (v3) → |
19 | | - </a> |
20 | | - </div> |
21 | | - <DocsHeader /> |
| 25 | + <div> |
| 26 | + <!-- Version Warning Banner --> |
| 27 | + <div |
| 28 | + v-if="isOldVersion" |
| 29 | + class="bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 px-4 py-2 text-center text-sm border-b border-amber-200 dark:border-amber-800" |
| 30 | + > |
| 31 | + You are viewing documentation for Flowforge {{ currentVersion }}. |
| 32 | + <a |
| 33 | + href="/flowforge/" |
| 34 | + class="underline font-medium hover:text-amber-900 dark:hover:text-amber-100" |
| 35 | + > |
| 36 | + View the latest version (v3) → |
| 37 | + </a> |
22 | 38 | </div> |
| 39 | + |
| 40 | + <!-- Original Docus Header --> |
| 41 | + <UHeader |
| 42 | + :ui="{ center: 'flex-1' }" |
| 43 | + :to="localePath('/')" |
| 44 | + :title="appConfig.header?.title || site.name" |
| 45 | + > |
| 46 | + <AppHeaderCenter /> |
| 47 | + |
| 48 | + <template #title> |
| 49 | + <AppHeaderLogo class="h-6 w-auto shrink-0" /> |
| 50 | + </template> |
| 51 | + |
| 52 | + <template #right> |
| 53 | + <AppHeaderCTA /> |
| 54 | + |
| 55 | + <template v-if="isEnabled && locales.length > 1"> |
| 56 | + <ClientOnly> |
| 57 | + <LanguageSelect /> |
| 58 | + |
| 59 | + <template #fallback> |
| 60 | + <div class="h-8 w-8 animate-pulse bg-neutral-200 dark:bg-neutral-800 rounded-md" /> |
| 61 | + </template> |
| 62 | + </ClientOnly> |
| 63 | + |
| 64 | + <USeparator |
| 65 | + orientation="vertical" |
| 66 | + class="h-8" |
| 67 | + /> |
| 68 | + </template> |
| 69 | + |
| 70 | + <UContentSearchButton class="lg:hidden" /> |
| 71 | + |
| 72 | + <ClientOnly> |
| 73 | + <UColorModeButton /> |
| 74 | + |
| 75 | + <template #fallback> |
| 76 | + <div class="h-8 w-8 animate-pulse bg-neutral-200 dark:bg-neutral-800 rounded-md" /> |
| 77 | + </template> |
| 78 | + </ClientOnly> |
| 79 | + |
| 80 | + <template v-if="links?.length"> |
| 81 | + <UButton |
| 82 | + v-for="(link, index) of links" |
| 83 | + :key="index" |
| 84 | + v-bind="{ color: 'neutral', variant: 'ghost', ...link }" |
| 85 | + /> |
| 86 | + </template> |
| 87 | + </template> |
| 88 | + |
| 89 | + <template #toggle="{ open, toggle }"> |
| 90 | + <IconMenuToggle |
| 91 | + :open="open" |
| 92 | + class="lg:hidden" |
| 93 | + @click="toggle" |
| 94 | + /> |
| 95 | + </template> |
| 96 | + |
| 97 | + <template #body> |
| 98 | + <AppHeaderBody /> |
| 99 | + </template> |
| 100 | + </UHeader> |
| 101 | + </div> |
23 | 102 | </template> |
0 commit comments