[RFC] build time interpolation of front matter in markdown / HTML (interpolate frontmatter) #871
Closed
1 of 9 tasks
Labels
alpha.1
CLI
discussion
tied to an ongoing discussion or meeting notes
documentation
Greenwood specific docs
feature
New feature or request
RFC
Proposal and changes to workflows, architecture, APIs, etc
SSR
v0.23.0
Milestone
Type of Change
Summary
At the risk of implementing / using a custom templating system (e.g. handlebars, nunjucks, etc), which is something Greenwood strives to avoid, but still recognizing that requiring JavaScript though graph.json even for static content, like what we support in frontmatter, can be a bit cumbersome.
For example, think about just trying to get that description or title into a
<meta>
tag. It requires JavaScript. This IMO is one key "lagging" / missing workflows Greenwood doesn't really have a good answer for. For referenceThis is why most tools reach for something like handbars.
Also, taking into consideration the spirit of this discussion on keeping content out of configuration, providing a familiar mechanism to a minumum static templating could be a really quick win so user's don't have to rely on JavaScript + prerendering for simple things.
Details
At its simplest, given the frontmatter example from before
A user could access this frontmatter data in their markdown our HTML on a per page instance following the convention of JavaScript template literals and Greenwood can interpolate them at build time.
Markdown
This would an example of using it in markdown file
Template
Requirements
interpolateFrontmatter
to enable this feature (and implement)The text was updated successfully, but these errors were encountered: