Skip to content

Commit e8d7dc4

Browse files
authored
docs: search filtering and move compiler macros (#3316)
1 parent ea9d126 commit e8d7dc4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/app.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ provide('navigation', navigation)
1919
const router = useRouter()
2020
2121
const isV7Docs = computed(() => router.currentRoute.value.path.includes('/docs/v7'))
22-
const isV9Docs = computed(() => router.currentRoute.value.path.includes('/docs/v9'))
22+
const isV8Docs = computed(() => router.currentRoute.value.path.includes('/docs/v8'))
2323
2424
// Search
2525
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
@@ -28,21 +28,21 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
2828
})
2929
3030
const v7DocsRE = /^\/docs\/v7/
31-
const v9DocsRE = /^\/docs\/v9/
31+
const v8DocsRE = /^\/docs\/v8/
3232
3333
const navigationV7 = computed(() => navigation.value?.[0].children.filter(x => v7DocsRE.test(String(x._path))))
34-
const navigationV9 = computed(() => navigation.value?.[0].children.filter(x => v9DocsRE.test(String(x._path))))
35-
const navigationV8 = computed(() =>
34+
const navigationV8 = computed(() => navigation.value?.[0].children.filter(x => v8DocsRE.test(String(x._path))))
35+
const navigationV9 = computed(() =>
3636
navigation.value?.[0].children.filter(x => {
3737
const to = String(x._path)
38-
return !v9DocsRE.test(to) && !v7DocsRE.test(to)
38+
return !v8DocsRE.test(to) && !v7DocsRE.test(to)
3939
})
4040
)
4141
4242
const currentVersionNavigation = computed(() => {
4343
if (isV7Docs.value) return navigationV7.value
44-
if (isV9Docs.value) return navigationV9.value
45-
return navigationV8.value
44+
if (isV8Docs.value) return navigationV8.value
45+
return navigationV9.value
4646
})
4747
4848
// Header

docs/content/docs/4.api/3.compiler-macros.md renamed to docs/content/docs/7.compiler-macros/1.define-i18n-route.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
2-
title: Compiler Macros
3-
description: Compiler Macros for Nuxt i18n module
2+
title: defineI18nRoute
43
---
54

65
`defineI18nRoute()`{lang="ts"} is a compiler macro that you can use to set custom route paths for your **page** components located in the `pages/` directory (unless [set otherwise](https://nuxt.com/docs/api/configuration/nuxt-config#pages-1)). This way you can set custom route paths for each static or dynamic route of your Nuxt application.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: Compiler Macros

0 commit comments

Comments
 (0)