diff --git a/src/hooks/usePosts.hook.ts b/src/hooks/usePosts.hook.ts index df40041..22e473e 100644 --- a/src/hooks/usePosts.hook.ts +++ b/src/hooks/usePosts.hook.ts @@ -1,23 +1,6 @@ +import { Post } from "@/modules/post/entities/Post" import { computed } from "vue" -interface Post { - filename: string - lastUpdated: Date - href: string - title: string - date: Date - meta: { - filename: string - lastUpdated: Date - href: string - } - frontmatter: { - title: string - publishedAt?: Date - } - draft?: boolean -} - const byMostRecentFirst = (a: Post, b: Post) => { if (!b.date) { return 1 @@ -33,9 +16,5 @@ const byMostRecentFirst = (a: Post, b: Post) => { export const usePosts = () => { const posts = $(useDocuments("@/pages/posts")) - return computed(() => - posts - .filter((post) => import.meta.env.DEV || post.draft !== true) - .sort(byMostRecentFirst) - ) + return computed(() => posts.sort(byMostRecentFirst)) } diff --git a/src/layouts/post.vue b/src/layouts/post.vue index e260c33..2ec8290 100644 --- a/src/layouts/post.vue +++ b/src/layouts/post.vue @@ -1,7 +1,13 @@ + +