diff --git a/components/ArchievCard.vue b/components/ArchievCard.vue index 299c038..253c4bb 100644 --- a/components/ArchievCard.vue +++ b/components/ArchievCard.vue @@ -1,8 +1,30 @@ + + diff --git a/components/ArchivePostCard.vue b/components/ArchivePostCard.vue deleted file mode 100644 index a56cf85..0000000 --- a/components/ArchivePostCard.vue +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/pages/archive.vue b/pages/archive.vue index 3d730be..a7dcd4e 100644 --- a/pages/archive.vue +++ b/pages/archive.vue @@ -2,16 +2,44 @@ definePageMeta({ layout: "list", }); + const { data } = await useAsyncData("home", () => queryContent("/").find()); + +const getAllPost = computed(() => { + const allpost = data.value || []; + const alltypes = allpost.map((post) => { + return { + title: post.title, + path: post._path, + date: post.date as string, + type: post.type, + }; + }); + alltypes.sort(function (a, b) { + const c = new Date(a.date); + const d = new Date(b.date); + return c < d ? 1 : -1; + }); + return alltypes; +});