Add 'exists' flags to content types and set them

This commit is contained in:
itsfinniii
2026-03-20 16:55:33 +01:00
parent 4bb3fa3671
commit b6f3fdd15e
10 changed files with 36 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ export async function getStaticPaths() {
const settings = await getSettings();
const page = await getPage(settings, Astro.url.pathname);
if (page === null) {
if (page === null || page.page === null) {
return new Response("Page not found.", {
status: 404,
statusText: "Not Found"
@@ -30,16 +30,16 @@ if (page === null) {
}
---
{ page.pageType === "Webpage" && (
{ page.page.type === "Webpage" && page.page.exists && (
<WebpageLayout settings={{
searchEngine: {
title: "",
description: "",
allowCrawlers: true,
canonical: null,
priority: 65,
title: page.page.searchEngine.title,
description: page.page.searchEngine.description,
allowCrawlers: page.page.searchEngine.allowCrawlers,
canonical: page.page.searchEngine.canonical,
priority: page.page.searchEngine.priority,
thumbnail: {
url: "",
url: page.page.searchEngine.thumbnail.url,
width: 1200,
height: 630
}