Update content page background

This commit is contained in:
adilallo
2025-09-30 08:43:32 -06:00
parent cc1d2ec7de
commit af4a08b934
7 changed files with 51 additions and 9 deletions
+16 -2
View File
@@ -54,6 +54,17 @@ export const BLOG_POST_SCHEMA = {
},
},
},
background: {
type: "object",
required: false,
default: null,
properties: {
color: {
type: "string",
required: false,
},
},
},
};
/**
@@ -149,8 +160,11 @@ export function sanitizeBlogPost(frontmatter) {
for (const [field, config] of Object.entries(BLOG_POST_SCHEMA)) {
if (frontmatter[field] !== undefined) {
// Special handling for thumbnail object
if (field === "thumbnail" && typeof frontmatter[field] === "object") {
// Special handling for thumbnail and background objects
if (
(field === "thumbnail" || field === "background") &&
typeof frontmatter[field] === "object"
) {
sanitized[field] = frontmatter[field];
} else {
sanitized[field] = frontmatter[field];