diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index a99ccc3bb..1fa4930fc 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -11,6 +11,8 @@ export interface Props {
description?: string;
ogImage?: string;
canonicalURL?: string;
+ pubDatetime?: Date;
+ modDatetime?: Date;
}
const {
@@ -19,6 +21,8 @@ const {
description = SITE.desc,
ogImage = SITE.ogImage,
canonicalURL = new URL(Astro.url.pathname, Astro.site).href,
+ pubDatetime,
+ modDatetime,
} = Astro.props;
const socialImageURL = new URL(
@@ -49,6 +53,24 @@ const socialImageURL = new URL(
+
+ {
+ pubDatetime && (
+
+ )
+ }
+ {
+ modDatetime && (
+
+ )
+ }
+
diff --git a/src/layouts/PostDetails.astro b/src/layouts/PostDetails.astro
index 88ad29408..1ec670e9b 100644
--- a/src/layouts/PostDetails.astro
+++ b/src/layouts/PostDetails.astro
@@ -36,6 +36,8 @@ const layoutProps = {
title,
author,
description,
+ pubDatetime,
+ modDatetime,
canonicalURL,
ogImage: ogUrl,
};