
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
gatsby-transformer-remark-frontmatter
Advanced tools
Allows querying frontmatter fields as markdown with gatsby-transformer-remark
Allows querying Markdown frontmatter fields as markdown. Currently only works on top-level string typed keys in the frontmatter, but support for string fields in objects or lists can be added if people ask for it enough or someone submits a pull request.
npm i gatsby-transformer-remark-frontmatter
// in your gatsby-config.js
plugins: [
'gatsby-transformer-remark',
'gatsby-transformer-remark-frontmatter'
]
Add the @md
directive to fields in your GraphQL schema that you want to
parse as Markdown.
Given the following markdown file
---
templateKey: index-template
sidebar: |
# Some Markdown Content

list:
- item: |
# Currently Supported
---
# Main Content
Some Text
The following GraphQL schema can be combined with the query below to get the body content and the sidebar markdown as html.
Schema:
type ListItem {
item: String @md
}
type Frontmatter @infer {
sidebar: String @md
list: [ListItem!]
}
type MarkdownRemark implements Node @infer {
frontmatter: Frontmatter!
}
Query:
query {
allMarkdownRemark(filter: { frontmatter: { templateKey: { eq: "index-template" } } }) {
html
frontmatter {
templateKey
sidebar {
html
}
list {
item {
html
}
}
}
}
}
Many plugins expect all MarkdownRemark
nodes to have File
node parents. This plugin passes data through those plugins, but at the
moment doesn't link the parent node to the original file. This may cause
some plugins that depend on MarkdownRemark parents to fail
(such as gatsby-remark-images).
FAQs
Allows querying frontmatter fields as markdown with gatsby-transformer-remark
We found that gatsby-transformer-remark-frontmatter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.