Add 'exists' flags to content types and set them
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user