-
-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support frontmatter defaults in the front end #337
Conversation
@@ -113,6 +114,8 @@ export class DocumentEdit extends Component { | |||
} = currentDocument; | |||
const [directory, ...rest] = params.splat; | |||
|
|||
const metafields = injectDefaultFields(config, directory, collection, front_matter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config
is since recently,
{"content": {"foo": "bar"}, "raw_content": "foo: bar\n"}
So either this line and all instances of config
passed to injectDefaultFields
should be changed to config.content
or change injectDefaultFields
function to extract defaults
from config.content
@mertkahyaoglu found a minor bug with this via |
Thanks @ashmaroli 👍 . Recently I came across with this library from Facebook that will fix this kind of console errors very easily. I will try to integrate this when I get some time. |
Ability to view frontmatter defaults in the front end. Frontmatter defaults are inserted into metadata section of pages/documents' views to let users visually see all of the fields they have.
To achieve this, we read frontmatter defaults from the config file and inject them into metadata of pages and documents.
Fixes #165