Take the article page color from the section banner SVG so the body cannot drift from the hero on current or future posts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-19 16:31:10 -06:00
co-authored by Cursor
parent 1a014f30f0
commit 0f16c559c4
5 changed files with 133 additions and 4 deletions
+9
View File
@@ -3,6 +3,7 @@ import path from "path";
import matter from "gray-matter";
import { validateBlogPost, sanitizeBlogPost } from "./validation";
import type { BlogPostFrontmatter } from "./validation";
import { resolveBlogPageBackgroundColor } from "./blogSectionBackground";
import { logger } from "./logger";
/**
@@ -104,6 +105,14 @@ export function parseBlogPost(filePath: string): BlogPost | null {
const sanitizedFrontmatter = sanitizeBlogPost(data);
const slug = generateSlug(filePath.replace(/\.mdx?$/, ""));
const pageBackground = resolveBlogPageBackgroundColor({
slug,
bannerFileName: sanitizedFrontmatter.banner?.horizontal,
frontmatterColor: sanitizedFrontmatter.background?.color,
});
if (pageBackground) {
sanitizedFrontmatter.background = { color: pageBackground };
}
return {
slug,