From aa93600c79a2a365dba1f4413d3c96d3cd8a2268 Mon Sep 17 00:00:00 2001 From: itsfinniii <102350242+itsfinniii@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:16:17 +0200 Subject: [PATCH] Add OG thumbnail to Photo Category Index --- astro/src/lib/pages.ts | 5 +++++ astro/src/pages/[...route].astro | 6 +++--- astro/src/types/photos/category.d.ts | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/astro/src/lib/pages.ts b/astro/src/lib/pages.ts index 1c031fb..a20b7c9 100644 --- a/astro/src/lib/pages.ts +++ b/astro/src/lib/pages.ts @@ -1,6 +1,7 @@ import { getBlog } from "@/content/blogs/blogs"; import { getWebpage } from "@/content/pages/pages"; import { getAlbum } from "@/content/photos/albums"; +import { getAllCategories } from "@/content/photos/categories"; import { getPhotoFromHash } from "@/content/photos/photos"; import { getProject } from "@/content/projects/projects"; @@ -91,10 +92,14 @@ export async function getPage(settings: GlobalSettings, route: string): Promise< } // Photo Category Index else if (regexToRoute({ template: settings.photo.categoryIndex.indexRouteTemplate, allowPagination: false }).regex.test(route)) { + const allCategories = await getAllCategories(settings); + const lastCategory = allCategories[0]; + return { route: route, pageType: "PhotoCategoryIndex", page: { + category: lastCategory, type: "PhotoCategoryIndex", exists: true } diff --git a/astro/src/pages/[...route].astro b/astro/src/pages/[...route].astro index 2c7d112..de330c8 100644 --- a/astro/src/pages/[...route].astro +++ b/astro/src/pages/[...route].astro @@ -147,13 +147,13 @@ if (page === null || page.page === null || !page.page.exists) { { page.pageType === "PhotoCategoryIndex" && (