From 5c5395dab672f06b68d530ac94eeda20e1f985fa Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Fri, 22 Dec 2023 23:53:24 +0900 Subject: [PATCH] =?UTF-8?q?(fix)=20CDN=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E6=99=82=E3=81=AE=E6=84=8F=E5=9B=B3=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=AA=E3=83=80=E3=82=A4=E3=83=AC=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BB=BD=E6=B8=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ components/content/MkIndex.vue | 2 +- components/content/ProseA.vue | 2 +- components/g/Footer.vue | 2 +- components/g/Nav.vue | 2 +- components/g/NuxtLink.vue | 2 +- components/index/Donation.vue | 2 +- components/index/GetStarted.vue | 2 +- components/index/hero/Left.vue | 2 +- components/tools/AsideNavSection.vue | 2 +- composables/useGLocalPath.ts | 17 +++++++++++++++++ error.vue | 2 +- layouts/tools.vue | 2 +- nuxt.config.ts | 3 ++- pages/about-us/index.vue | 2 +- pages/blog/[slug].vue | 2 +- pages/blog/index.vue | 2 +- pages/docs/index.vue | 2 +- pages/learn-more.vue | 2 +- pages/servers/index.vue | 2 +- pages/test.vue | 2 +- pages/tools/index.vue | 2 +- 22 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 composables/useGLocalPath.ts diff --git a/README.md b/README.md index 274eb3f6..c68a38fa 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Website for Misskey, built with [Nuxt](https://nuxt.com/). 内部リンク・外部リンクに関する処理を強化した[``](./components/g/NuxtLink.vue)を使用していますので、**リンクを追加する際は``ではなく``を使用してください。** +また、Nuxtのルーティングストラテジに、ホスティング環境に適した設定を適用するため、動的リンクの作成に使用する`useLocalePath`をラップしたコンポーサブル関数`useGLocalePath`を使うようにしています。 + ### Misskey Webへのリンクについて GNuxtLinkおよび各種Docsで、アドレスに `x-mi-web://` から始め、続けてMisskeyの相対パスを入力すると、Misskey Webへのリンクに置き換えられます。 diff --git a/components/content/MkIndex.vue b/components/content/MkIndex.vue index 77da4879..da3c3640 100644 --- a/components/content/MkIndex.vue +++ b/components/content/MkIndex.vue @@ -39,7 +39,7 @@ const realBasePath = computed(() => { return route.path.replace(/^.*\/docs/, `/${locale.value}/docs`); }); -const localePath = useLocalePath(); +const localePath = useGLocalePath(); const query = queryContent(realBasePath.value); diff --git a/components/content/ProseA.vue b/components/content/ProseA.vue index 1dbf6827..65f9b187 100644 --- a/components/content/ProseA.vue +++ b/components/content/ProseA.vue @@ -7,7 +7,7 @@ import { isLocalPath, sanitizeInternalPath } from '@/assets/js/misc'; const runtimeConfig = useRuntimeConfig(); const rootDomain = new $URL(runtimeConfig.public.baseUrl); const { resolve } = useRouter(); -const localePath = useLocalePath(); +const localePath = useGLocalePath(); const props = defineProps({ href: { diff --git a/components/g/Footer.vue b/components/g/Footer.vue index 581e0a3a..925d8419 100644 --- a/components/g/Footer.vue +++ b/components/g/Footer.vue @@ -64,7 +64,7 @@ import MiIcon from '@/assets/svg/misskey_mi_bi.svg'; import ExtIco from 'bi/box-arrow-up-right.svg'; -const localePath = useLocalePath(); +const localePath = useGLocalePath();