diff --git a/pages/src/content/config.ts b/pages/src/content/config.ts index 66ffd11..bc9d1c3 100644 --- a/pages/src/content/config.ts +++ b/pages/src/content/config.ts @@ -20,6 +20,10 @@ const blog = defineCollection({ proofread_date: z.union( [z.date(), z.string(), z.number()] ).default(""), + publisher: z.string().default(SITE.author), + published_date: z.union( + [z.date(), z.string(), z.number()] + ).default(""), }), }); diff --git a/pages/src/layouts/PostDetails.astro b/pages/src/layouts/PostDetails.astro index 2988fc7..5f6d883 100644 --- a/pages/src/layouts/PostDetails.astro +++ b/pages/src/layouts/PostDetails.astro @@ -13,7 +13,7 @@ export interface Props { const { post } = Astro.props; -const { title, author, collected_date, collector, translated_date, translator, link, proofreader, proofread_date } = post.data; +const { title, author, collected_date, collector, translated_date, translator, link, proofreader, proofread_date, publisher, published_date } = post.data; const { Content } = await post.render(); @@ -62,30 +62,32 @@ const layoutProps = {
- - { - translated_date && ( -

译自: {link}

-

+

{!translated_date ? "原文链接:": "译自:"} {link}

+

+ 选题: + {collector} + {translated_date && ( + +    译者: {translator} - { - proofread_date && ( + {proofread_date && ( + +    校对:{proofreader} -

本文由HCTT原创翻译,华科开放原子俱乐部荣誉推出。

- ) - } -

- ) - } - - { - !translated_date && ( -

原文链接: {link}

- ) - } - -
+ + )} + {published_date && ( + +    + 发布:{publisher} + + )} + + )} +

+

本文{!translated_date && "将"}由 HCTT 翻译团队 原创翻译,华中科技大学开放原子开源俱乐部荣誉推出。

+