How to use gray-matter

Comprehensive gray-matter code examples:

How to use gray-matter.read:

61
62
63
64
65
66
67
68
69
70
	.pop()
	.replace(/\.[^/.]+$/, "")
// Markdown Files Logic
if (file?.endsWith(".md")) {
	// Read the Markdown file and parse it's front matter
	const mdFile = matter.read(file)

	// Convert the Markdown file content to HTML with markdown-it
	// Allows HTML tags inside the Markdown file, use highlight.js with markdown-it and highlight inline code
	const md = require("markdown-it")({ html: true }).use(require("markdown-it-highlightjs"), {