From 98c9a32709ba3167634213b5391aaf804affeb5d Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Sun, 24 Sep 2023 03:02:04 +0900 Subject: [PATCH] (Add) AsideNav --- assets/js/misc/index.ts | 4 +- components/content/ApiPermissions.vue | 6 +- components/docs/AsideNav.vue | 77 ++++++++++++++--------- components/g/Nav.vue | 6 +- content/ja/docs/4.for-developers/_dir.yml | 2 + error.vue | 5 ++ layouts/docs.vue | 29 ++++++++- locales/ja-JP.yml | 6 +- package.json | 1 + pages/docs/[...slug].vue | 48 ++++++-------- pnpm-lock.yaml | 3 + scripts/gen-api-translations.ts | 19 +++++- 12 files changed, 138 insertions(+), 68 deletions(-) create mode 100644 content/ja/docs/4.for-developers/_dir.yml diff --git a/assets/js/misc/index.ts b/assets/js/misc/index.ts index 94a49671..e9b6f873 100644 --- a/assets/js/misc/index.ts +++ b/assets/js/misc/index.ts @@ -1,3 +1,5 @@ +import type { NavItem } from '@nuxt/content/dist/runtime/types'; + export function resolveObjPath(o: object, s: string): any { s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties s = s.replace(/^\./, ''); // strip a leading dot @@ -40,7 +42,7 @@ export function isLocalPath(link: string, base?: string): boolean { } -export const findDeepObject = (obj: Record, condition: (v: any) => boolean): Record | null => { +export const findDeepObject = (obj: NavItem, condition: (v: NavItem) => boolean): NavItem | null => { if (condition(obj)) { return obj; } diff --git a/components/content/ApiPermissions.vue b/components/content/ApiPermissions.vue index 829ba6f2..9718d189 100644 --- a/components/content/ApiPermissions.vue +++ b/components/content/ApiPermissions.vue @@ -2,14 +2,14 @@ - - + + - +
PermissonDescription{{ $t('_api._permissions.title') }}{{ $t('_api._permissions.description') }}
{{ permission }}{{ $t(`_api._permissions.${permission}`) }}{{ $t(`_api._permissions._types.${permission}`) }}
diff --git a/components/docs/AsideNav.vue b/components/docs/AsideNav.vue index 07a695d6..2282c1e2 100644 --- a/components/docs/AsideNav.vue +++ b/components/docs/AsideNav.vue @@ -1,61 +1,78 @@ \ No newline at end of file diff --git a/components/g/Nav.vue b/components/g/Nav.vue index 046a9719..28016241 100644 --- a/components/g/Nav.vue +++ b/components/g/Nav.vue @@ -9,7 +9,7 @@