How to use the read function from gray-matter
Find comprehensive JavaScript gray-matter.read code examples handpicked from public code repositorys.
GitHub: LebCit/blog-doc-space
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"), {
0
6
1
+ 3 other calls in file
GitHub: VekLabs/veklabs.com
140 141 142 143 144 145 146 147 148 149 150 151
async function getAvatar(author) { try { const authorMd = path.join(__dirname, "../../content/team", author + ".md") const { data } = frontmatter.read(authorMd, { engines: { toml: toml.parse.bind(toml) }, delimiters: "+++", language: "toml", })
0
0
0
gray-matter.read is the most popular function in gray-matter (6 examples)