MCPcopy
hub / github.com/npmx-dev/npmx.dev / normalizeBlogFrontmatter

Function normalizeBlogFrontmatter

modules/standard-site-sync.ts:158–163  ·  view source on GitHub ↗
(frontmatter: Record<string, unknown>)

Source from the content-addressed store, hash-verified

156
157// Schema expects 'path' & frontmatter provides 'slug'
158function normalizeBlogFrontmatter(frontmatter: Record<string, unknown>): Record<string, unknown> {
159 return {
160 ...frontmatter,
161 path: typeof frontmatter.slug === 'string' ? `/blog/${frontmatter.slug}` : frontmatter.path,
162 }
163}
164
165// Keys are sorted to provide a more stable hash
166function createContentHash(data: unknown): string {

Callers 1

syncFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected