From 9bcd809493c077dfcbcd99586e985c31a8ce8e7e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 28 Sep 2024 13:29:05 +0800 Subject: [PATCH] :lipstick: Better docs page --- content/zh-CN/docs/solar-network/index.mdx | 7 ++ layouts/docs.vue | 103 +++++++++++++++++++++ pages/docs/[...slug].vue | 85 ++++++++++------- utils/locale.ts | 8 +- 4 files changed, 164 insertions(+), 39 deletions(-) create mode 100644 content/zh-CN/docs/solar-network/index.mdx create mode 100644 layouts/docs.vue diff --git a/content/zh-CN/docs/solar-network/index.mdx b/content/zh-CN/docs/solar-network/index.mdx new file mode 100644 index 0000000..240fe86 --- /dev/null +++ b/content/zh-CN/docs/solar-network/index.mdx @@ -0,0 +1,7 @@ +--- +icon: mdi-open-in-app +title: Solar Network +description: Solsynth LLC 的下一代社交网络 +--- + +Solar Network 是 Solsynth LLC 开发的社交网络,目标成为下一代社交网络。 diff --git a/layouts/docs.vue b/layouts/docs.vue new file mode 100644 index 0000000..2c43e3d --- /dev/null +++ b/layouts/docs.vue @@ -0,0 +1,103 @@ + + + diff --git a/pages/docs/[...slug].vue b/pages/docs/[...slug].vue index ef26870..d8e7fcc 100644 --- a/pages/docs/[...slug].vue +++ b/pages/docs/[...slug].vue @@ -17,23 +17,57 @@ -
- -
- -
-
-
+ + + + + + + + + + + + + + + + + + +
+
+

Created By

+
+
+
+
+
+ + @@ -99,6 +111,7 @@ useSeoMeta({ border-radius: 8px; } + html, body, .v-application, .docs-article { scroll-behavior: smooth; } diff --git a/utils/locale.ts b/utils/locale.ts index 7aefc57..0037e8d 100644 --- a/utils/locale.ts +++ b/utils/locale.ts @@ -1,7 +1,9 @@ -export function getLocale() { +export function getLocale(locale?: any) { const fallbackLocale = "en" const supportedLocales = ["en", "zh-CN"] - const { locale } = useI18n() + if (locale == null) { + locale = useI18n().locale + } - return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale; + return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale }