From b4b820af79a6b8ff39074b37b6f635696719443e Mon Sep 17 00:00:00 2001 From: Max batleforc Date: Fri, 20 Sep 2024 10:45:43 +0200 Subject: [PATCH] feat: correction hyperlink techno ++ date --- apps/front/src/component/Page/PageMetadata.vue | 2 +- apps/front/src/stores/doc.ts | 11 ++++++++++- apps/front/src/stores/page.ts | 2 ++ folio_content/content/Techno/Infra/Kube/index.md | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/front/src/component/Page/PageMetadata.vue b/apps/front/src/component/Page/PageMetadata.vue index 45f36a3..fd54a1a 100644 --- a/apps/front/src/component/Page/PageMetadata.vue +++ b/apps/front/src/component/Page/PageMetadata.vue @@ -18,7 +18,7 @@ defineProps<{

{{ metadata.writter.name }}

-

{{ metadata.date }}

+

{{ new Date(metadata.date).toLocaleString() }}

diff --git a/apps/front/src/stores/doc.ts b/apps/front/src/stores/doc.ts index 5c64937..0967c1f 100644 --- a/apps/front/src/stores/doc.ts +++ b/apps/front/src/stores/doc.ts @@ -65,8 +65,17 @@ export const useDocStore = defineStore({ techno: string, category: DocCategory, ): PageShort | undefined { + if ( + category.name.toLowerCase() === techno.toLowerCase() && + category.has_index + ) { + return category.pages.find((page) => page.name === 'index'); + } for (const page of category.pages) { - if (page.name.toLowerCase() === techno.toLowerCase()) { + if ( + page.name.toLowerCase() === techno.toLowerCase() || + page.metadata.title.toLowerCase() === techno.toLowerCase() + ) { return page; } } diff --git a/apps/front/src/stores/page.ts b/apps/front/src/stores/page.ts index c14fd8e..f65c810 100644 --- a/apps/front/src/stores/page.ts +++ b/apps/front/src/stores/page.ts @@ -42,6 +42,8 @@ export const usePageStore = defineStore({ .catch((err) => { console.error(err); this.loadingError = 'Failed to load page'; + this.pagePath = ''; + this.page = undefined; }) .finally(() => { this.pageLoading = false; diff --git a/folio_content/content/Techno/Infra/Kube/index.md b/folio_content/content/Techno/Infra/Kube/index.md index a7420bd..0ee08c3 100644 --- a/folio_content/content/Techno/Infra/Kube/index.md +++ b/folio_content/content/Techno/Infra/Kube/index.md @@ -1,6 +1,6 @@ --- date: 2024-07-16T22:51:00Z -title: "kubernetes" +title: "Kubernetes" description: "Kubernetes - Container Orchestration" spec: blog: false