From e9fcc0a4e7eb6c073e3f0f93fe61cc584f5e5380 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Tokuda <108762+tokuda109@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:05:30 +0900 Subject: [PATCH 1/6] feat: add a link to discussion thread --- components/PanelDocs.vue | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/components/PanelDocs.vue b/components/PanelDocs.vue index e39f69f..a0662bf 100644 --- a/components/PanelDocs.vue +++ b/components/PanelDocs.vue @@ -63,6 +63,31 @@ const sourceUrl = computed(() => : undefined, ) +const threadIdMappings: { [key: string]: number } = { + '0.index.md': 85, + '1.vue/1.index.md': 68, + '1.vue/2.reactivity/index.md': 71, + '1.vue/3.reactivity-2/index.md': 72, + '1.vue/4.composition-api/index.md': 73, + '1.vue/5.components/index.md': 74, + '1.vue/6.summary/index.md': 75, + '2.concepts/1.index.md': 76, + '2.concepts/2.app-vue/index.md': 77, + '2.concepts/3.routing/index.md': 78, + '2.concepts/4.auto-imports/index.md': 79, + '2.concepts/5.middleware/index.md': 80, + '2.concepts/6.layout/index.md': 81, + '2.concepts/7.rendering-modes/index.md': 82, + '2.concepts/8.state-manegement/index.md': 83, + '2.concepts/9.data-fetching/index.md': 84, +} + +const threadUrl = computed(() => + page.value?._file + ? `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${threadIdMappings[page.value._file]}` + : undefined, +) + const docsEl = ref(null) const router = useRouter() router.beforeEach(() => { @@ -118,7 +143,7 @@ router.beforeEach(() => { /> -
+
{
Edit this page + +
+ Ask your question +
From a68b096ac9419a04d4249b1d63c259c07000efcb Mon Sep 17 00:00:00 2001 From: Tsuyoshi Tokuda <108762+tokuda109@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:58:21 +0900 Subject: [PATCH 2/6] Update components/PanelDocs.vue Co-authored-by: ubugeeei <71201308+ubugeeei@users.noreply.github.com> --- components/PanelDocs.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/PanelDocs.vue b/components/PanelDocs.vue index a0662bf..83ad20c 100644 --- a/components/PanelDocs.vue +++ b/components/PanelDocs.vue @@ -63,7 +63,8 @@ const sourceUrl = computed(() => : undefined, ) -const threadIdMappings: { [key: string]: number } = { +// NOTE: remove when hands-on finished (will be held on 2024-10-19) +const THREAD_ID_MAP = { '0.index.md': 85, '1.vue/1.index.md': 68, '1.vue/2.reactivity/index.md': 71, From 6b4c6bda5cd89130bd05554dc54119486fc0ac08 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Tokuda <108762+tokuda109@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:58:40 +0900 Subject: [PATCH 3/6] Update components/PanelDocs.vue Co-authored-by: ubugeeei <71201308+ubugeeei@users.noreply.github.com> --- components/PanelDocs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/PanelDocs.vue b/components/PanelDocs.vue index 83ad20c..b2ccd5d 100644 --- a/components/PanelDocs.vue +++ b/components/PanelDocs.vue @@ -84,7 +84,7 @@ const THREAD_ID_MAP = { } const threadUrl = computed(() => - page.value?._file + page.value?._file && threadIdMappings[page.value._file] ? `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${threadIdMappings[page.value._file]}` : undefined, ) From 6560dc5097619ffbbbc9f00ea98c73238c854272 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Tokuda <108762+tokuda109@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:58:52 +0900 Subject: [PATCH 4/6] Update components/PanelDocs.vue Co-authored-by: ubugeeei <71201308+ubugeeei@users.noreply.github.com> --- components/PanelDocs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/PanelDocs.vue b/components/PanelDocs.vue index b2ccd5d..be7a92f 100644 --- a/components/PanelDocs.vue +++ b/components/PanelDocs.vue @@ -81,7 +81,7 @@ const THREAD_ID_MAP = { '2.concepts/7.rendering-modes/index.md': 82, '2.concepts/8.state-manegement/index.md': 83, '2.concepts/9.data-fetching/index.md': 84, -} +} as const satisfies Record const threadUrl = computed(() => page.value?._file && threadIdMappings[page.value._file] From ea2645637f6b55c447bb9006e017f57287b0e1d7 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Tokuda <108762+tokuda109@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:29:24 +0900 Subject: [PATCH 5/6] fix: type errors --- components/PanelDocs.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/PanelDocs.vue b/components/PanelDocs.vue index be7a92f..6345312 100644 --- a/components/PanelDocs.vue +++ b/components/PanelDocs.vue @@ -1,3 +1,4 @@ +