From f8b65485e85cd692ccf05c03beb9e6aa207d0677 Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Sun, 24 Nov 2024 22:46:21 +0800 Subject: [PATCH] add embedded youtube --- src/config.ts | 4 ++-- src/layouts/PostDetails.astro | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index e8a90ec..0de06f4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -29,8 +29,8 @@ export const SITE: Site = { title: "KaLUG.tw", ogImage: "kalug-people.jpg", lightAndDarkMode: true, - postPerIndex: 4, - postPerPage: 3, + postPerIndex: 5, + postPerPage: 10, //scheduledPostMargin: 15 * 60 * 1000, // 15 minutes scheduledPostMargin: 30 * 24 * 60 * 60 * 1000, // 15 minutes showArchives: true, diff --git a/src/layouts/PostDetails.astro b/src/layouts/PostDetails.astro index 253068a..ca0a2cf 100644 --- a/src/layouts/PostDetails.astro +++ b/src/layouts/PostDetails.astro @@ -26,6 +26,7 @@ const { pubDatetime, modDatetime, tags, + youtube, editPost, } = post.data; @@ -37,6 +38,8 @@ const ogUrl = new URL( Astro.url.origin ).href; +const ylink = "https://www.youtube.com/embed/"+youtube; + const layoutProps = { title: `${title} | ${SITE.title}`, author, @@ -88,6 +91,14 @@ const nextPost = postId={post.id} />
+ { + youtube && ( +
+ +
+ ) + } +