fix: add links to relevant style guide
This commit is contained in:
committed by
mrugesh mohapatra
parent
dd2b40bfd7
commit
fb121b39d2
@@ -1,18 +1,19 @@
|
||||
const matter = require('gray-matter');
|
||||
const _ = require('lodash');
|
||||
const dedent = require('dedent');
|
||||
|
||||
const frontmatterCheck = (fullPath, isTranslation, fileContent) => {
|
||||
const { data: frontmatter } = matter(fileContent);
|
||||
let errors = [];
|
||||
if (!frontmatter || _.isEmpty(frontmatter) || !frontmatter.title) {
|
||||
errors.push({
|
||||
msg: `Misplaced frontmatter or missing \`title key\` frontmatter.`,
|
||||
msg: `Misplaced or missing \`title\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`,
|
||||
fullPath
|
||||
});
|
||||
}
|
||||
if (isTranslation && !frontmatter.localeTitle) {
|
||||
errors.push({
|
||||
msg: `Missing \`localeTitle key\`frontmatter.`,
|
||||
msg: `Missing \`localeTitle\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`,
|
||||
fullPath
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user