diff --git a/src/common/interfaces/Post.ts b/src/common/interfaces/Post.ts index c10f48d..7f58871 100644 --- a/src/common/interfaces/Post.ts +++ b/src/common/interfaces/Post.ts @@ -1,6 +1,8 @@ interface Post { path: string title: string + time: string + author: string } export { Post } diff --git a/src/composables/usePosts.ts b/src/composables/usePosts.ts index 43bbec3..fc14203 100644 --- a/src/composables/usePosts.ts +++ b/src/composables/usePosts.ts @@ -5,6 +5,8 @@ import type { Post } from '~/common/interfaces/Post' type Meta = { frontmatter: { title: string + time: string + author: string } } & RouteMeta @@ -17,6 +19,6 @@ export default (): Post[] => { return routes.map((route) => { const meta = route.meta as Meta - return { path: route.path, title: meta.frontmatter.title } + return { path: route.path, ...meta.frontmatter } }) } diff --git a/src/posts/index.vue b/src/pages/posts.vue similarity index 100% rename from src/posts/index.vue rename to src/pages/posts.vue diff --git a/src/posts/contribute.md b/src/posts/contribute.md index 79be173..7c43c8d 100644 --- a/src/posts/contribute.md +++ b/src/posts/contribute.md @@ -1,5 +1,7 @@ --- title: "贡献指南" +author: "thehrz" +time: "2023-02-15T22:23:48+08:00" --- # 贡献指南