Skip to content

Commit c3e610b

Browse files
committed
Update markdown checker to check for skill level and stray sidebar frontmatters
1 parent 354d5d6 commit c3e610b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/scripts/markdown-checker.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ function processFrontmatter(path, lang) {
111111
)
112112
}
113113

114+
if (frontmatter.sidebar) {
115+
console.error(`Unexpected 'sidebar' frontmatter at ${path}`)
116+
}
117+
114118
if (path.includes("/tutorials/")) {
115119
if (!frontmatter.published) {
116120
console.warn(`Missing 'published' frontmatter at ${path}:`)
@@ -130,6 +134,16 @@ function processFrontmatter(path, lang) {
130134
)
131135
}
132136
}
137+
138+
if (
139+
frontmatter.skill !== "beginner" &&
140+
frontmatter.skill !== "intermediate" &&
141+
frontmatter.skill !== "advanced"
142+
) {
143+
console.log(
144+
`Skill frontmatter '${frontmatter.skill}' must be: beginner, intermediate, or advanced at: ${path}:`
145+
)
146+
}
133147
}
134148
}
135149

0 commit comments

Comments
 (0)