diff --git a/src/layouts/UnstyledBase.astro b/src/layouts/UnstyledBase.astro index a2200e52..d2ce7d25 100644 --- a/src/layouts/UnstyledBase.astro +++ b/src/layouts/UnstyledBase.astro @@ -9,12 +9,18 @@ import defaultOgImage from "../images/default.png"; interface Props { title: string; description: string; - ogImage?: string; - ogAlt?: string; + previewImage?: { + image: ImageMetadata; + alt: string; + }; } -const { title, description, ogImage, ogAlt } = Astro.props; -const image = await getImage({ src: ogImage ?? defaultOgImage, width: 1200 }); +const { title, description, previewImage } = Astro.props; +const image = await getImage({ + src: previewImage?.image ?? defaultOgImage, + width: 1200, + height: 630, +}); const canonicalURL = new URL(Astro.url.pathname, Astro.site); const pageTitle = Astro.url.pathname === "/" ? title : `${title} · Ky Decker`; @@ -66,7 +72,7 @@ const pageTitle = Astro.url.pathname === "/" ? title : `${title} · Ky Decker`; diff --git a/src/pages/[id].astro b/src/pages/[id].astro index c4444449..1b907c76 100644 --- a/src/pages/[id].astro +++ b/src/pages/[id].astro @@ -19,17 +19,23 @@ export async function getStaticPaths() { const { page } = Astro.props; const { data } = page; const { Content } = await render(page); +const { + title, + description, + datePublished, + dateModified, + headerImage, + previewImage, +} = data; --- diff --git a/src/pages/guestbook.astro b/src/pages/guestbook.astro deleted file mode 100644 index bddc4966..00000000 --- a/src/pages/guestbook.astro +++ /dev/null @@ -1,70 +0,0 @@ ---- -import GuestbookEntries from "../components/Guestbook/GuestbookEntries.astro"; -import GuestbookPagination from "../components/Guestbook/GuestbookPagination.astro"; -import Notecard from "../components/Notecard/Notecard.astro"; -import { NotecardComposer } from "../components/Notecard/NotecardComposer"; -import BaseLayout from "../layouts/BaseLayout.astro"; - -export const prerender = false; - -// Get the current page from search params -const currentPage = Number(Astro.url.searchParams.get("page")) || 1; - -// Redirect page=1 to base URL -if (currentPage === 1 && Astro.url.searchParams.has("page")) { - return Astro.redirect("/guestbook"); -} - -const isFirstPage = currentPage === 1; - -const title = "Guestbook"; -const description = "Leave a message in ky.fyi."; ---- - - - Guestbook - - {isFirstPage && } - - - { - Array.from({ length: 24 }).map(() => ( - - )) - } - - - - - - - - - diff --git a/src/pages/index.astro b/src/pages/index.astro index b6afe5d5..e84ccf02 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -22,7 +22,7 @@ const feed = work year: post.data.datePublished.getFullYear(), url: `/posts/${post.id}`, category: post.data.type === "case-study" ? "case study" : "writing", - img: post.data.img, + previewImage: post.data.previewImage, })), ) .sort((a, b) => b.year - a.year); diff --git a/src/pages/posts/[id].astro b/src/pages/posts/[id].astro index 2e03ec5b..06c1b75b 100644 --- a/src/pages/posts/[id].astro +++ b/src/pages/posts/[id].astro @@ -25,13 +25,13 @@ const { post, prev, next } = Astro.props; const { Content } = await render(post); const { data } = post; -const { title, description, ogImage, datePublished, dateModified } = data; +const { title, description, previewImage, datePublished, dateModified } = data; --- diff --git a/src/pages/webrings.astro b/src/pages/webrings.astro deleted file mode 100644 index 9925a751..00000000 --- a/src/pages/webrings.astro +++ /dev/null @@ -1,109 +0,0 @@ ---- -import { getCollection, getEntry } from "astro:content"; -import Webring from "src/components/Webring.astro"; - -import Center from "../components/Center.astro"; -import PageHeader from "../components/PageHeader.astro"; -import madeWithHands from "../content/badges/gossips-web.jpeg"; -import BaseLayout from "../layouts/BaseLayout.astro"; - -const webrings = await getCollection("webrings"); -const badges = await getEntry("badges", "badges"); - -const title = "Webrings"; -const description = - "Webrings let you browse related sites in one big loop—ky.fyi belongs to a few!"; - -const datePublished = new Date("2024-05-16"); -const dateModified = new Date("2025-04-21 12:35:00-04:00"); ---- - - - - - - - {webrings.map((webring) => )} - - - - - - { - badges?.data.map((badge) => ( - - - - )) - } - - - 88×31 buttons from hellnet.work, yesterweb.org, cyber.dabamos.de, lmnt.me, and other - friends. - - - - - - - -