1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Support a new contentType frontmatter property (#56715)

This commit is contained in:
Sarah Schneider
2025-07-23 11:47:04 -04:00
committed by GitHub
parent 45c42cfb34
commit 2b0e25a26d
7 changed files with 220 additions and 3 deletions

View File

@@ -17,8 +17,24 @@ const layoutNames = [
false,
]
// DEPRECATED: Use 'contentType' instead of 'type' for new content.
// 'type' exists on ~40% of files but is used only for internal analytics.
// Migration tool: src/content-render/scripts/add-content-type.ts
const guideTypes = ['overview', 'quick_start', 'tutorial', 'how_to', 'reference', 'rai']
// As of July 2025, use 'contentType' rather than 'type'.
export const contentTypesEnum = [
'get-started',
'concepts',
'how-tos',
'reference',
'tutorials',
'homepage', // Only applies to the sole 'content/index.md' file (the homepage).
'landing', // Only applies to 'content/<product>/index.md' files (product landings).
'rai', // Only applies to files that live in directories with 'responsible-use' in the name.
'other', // Everything else.
]
export const schema = {
type: 'object',
required: ['title', 'versions'],
@@ -150,10 +166,18 @@ export const schema = {
prefix: { type: 'string' },
},
},
// DEPRECATED: Use 'contentType' instead of 'type' for new content.
// 'type' exists on ~40% of files but is used only for internal analytics.
// Migration tool: src/content-render/scripts/add-content-type.ts
type: {
type: 'string',
enum: guideTypes,
},
// As of July 2025, use 'contentType' rather than 'type'.
contentType: {
type: 'string',
enum: contentTypesEnum,
},
topics: {
type: 'array',
},