Skip to content

Commit

Permalink
fix(toml): use +++ for TOML frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Mar 15, 2021
1 parent 932b148 commit bb6884a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
17 changes: 12 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions src/seocheck.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ export default function check(file) {
value: parseInt(core.getInput('max_slug_length'))
})

const frontmatter = matter(file.content, {
engines: {
toml: toml.parse.bind(toml)
}
})
let frontmatter
if (file.content.startsWith('+++')) {
frontmatter = matter(file.content, {
language: 'toml',
delims: '+++',
engines: {
toml: toml.parse.bind(toml)
}
})
} else {
frontmatter = matter(file.content)
}

if (
!frontmatter ||
Expand Down

0 comments on commit bb6884a

Please sign in to comment.