Skip to content

Commit 8d83476

Browse files
follow to js-yaml4.0.0
1 parent 4cff49d commit 8d83476

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

package-lock.json

Lines changed: 16 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/posts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function fetchPostContent(): PostContent[] {
3131
// Use gray-matter to parse the post metadata section
3232
const matterResult = matter(fileContents, {
3333
engines: {
34-
yaml: (s) => yaml.safeLoad(s, { schema: yaml.JSON_SCHEMA }) as object,
34+
yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object,
3535
},
3636
});
3737
const matterData = matterResult.data as {

src/pages/posts/[post].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
6666
const slug = params.post as string;
6767
const source = fs.readFileSync(slugToPostContent[slug].fullPath, "utf8");
6868
const { content, data } = matter(source, {
69-
engines: { yaml: (s) => yaml.safeLoad(s, { schema: yaml.JSON_SCHEMA }) as object }
69+
engines: { yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object }
7070
});
7171
const mdxSource = await renderToString(content, { components, scope: data });
7272
return {

0 commit comments

Comments
 (0)