Skip to content

Fix invalid OG frontmatter structure across all MDX pages #118

@Konstantin-Zhukov

Description

@Konstantin-Zhukov

Description

All 146 MDX pages have title, description, and schema nested inside the seo.og block, but the DWT theme's OgConfig type does not include these properties. This causes a TypeScript build error and prevents CI from passing.


Steps to Reproduce

  1. Run npm run build on the repository
  2. Observe TypeScript compilation failure in pageMap.ts

Expected Behavior

Build completes successfully. og:title and og:description are derived automatically from the top-level title and description frontmatter fields. Structured data (schema) is rendered as a JSON-LD <script> tag in the page <head>.


Actual Behavior

Build fails with:

Type error: Object literal may only specify known properties, and '"title"' does not exist in type 'OgConfig'.

The schema block inside og is also silently ignored at runtime since it is in the wrong position.


Root Cause

OgConfig (from @document-writing-tools/kernux-theme v2.0.1) only accepts:

interface OgConfig {
  image?: string;
  image_alt?: string;
  image_width?: number;
  image_height?: number;
  type?: "article" | "website";
}

title, description, and schema must not appear inside og. schema belongs at the seo level. Additionally, schema type values WebSite and WebPage are not supported — valid values are Article, TechArticle, HowTo, FAQPage.


Proposed Solution

For all 146 affected MDX files:

  • Remove title and description from inside the og block (they are auto-derived from top-level fields)
  • Move schema from inside og to the seo level
  • Drop schema blocks whose type is WebSite or WebPage (8 pages total) since these types are unsupported

Acceptance Criteria

  • npm run build passes without TypeScript errors
  • No MDX file contains title, description, or schema inside the seo.og block
  • Pages with TechArticle schema emit a valid JSON-LD <script> tag in the rendered HTML
  • Pages previously using WebSite/WebPage schema types have the schema block removed

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions