-
Notifications
You must be signed in to change notification settings - Fork 30
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
Document Arbitrary Metadata for All Content #103
base: master
Are you sure you want to change the base?
Conversation
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.
nice work, some small suggestions about the default data for a blueprint but when that is fixed it should be good to go.
Also can you revert your changes to package-lock.json as this PR doesn't affect the deps (I think it's because you're using npm@6 instead of npm@7)
fc5fc99
to
980c644
Compare
@mansona I've addressed or responded to all the comments. Can you do another pass? |
What's the status here? |
This change adds a `meta` attribute to the Front Matter section of every type of content supported by `empress-blog`. This attribute is treated as an arbitrary JSON blob by the Ember-Data models, supporting string, array, and/or object formats. The `meta` attribute is not used by `empress-blog` by default, but it enables developer support for adding metadata to authors, content, pages, and tags. The blueprints have been updated such that all generators will add a `meta` attribute, making it clear to users that it is supported. Documentation has been updated to mention this feature is available, and some of the default generated content has had different examples of a `meta` attribute added in those markdown files. I am not sure how to test this, however, since the existing `meta-tests` appears to exclusively assert the output of Front Matter attributes rendered to the DOM, and by default the `meta` attribute is not rendered by `empress-blog` without custom features being added. However, it is clear from running Ember Inspector that the Ember-Data models have correctly parsed each of the `meta` examples added by this change.
I've changed the title of this PR so that it's about documentation now, since the implementation was merged in #142 👍 We can continue our discussions and get this merged (eventually 😂 ) |
@nickschot if you could review this, that would be great. I spoke about this feature and its implementation details with @mansona today, and I believe we're both on the same page about using this approach to enable arbitrary metadata in user land.
This change adds a
meta
attribute to the Front Matter section of every type of content supported byempress-blog
. This attribute is treated as an arbitrary JSON blob by the Ember-Data models, supporting string, array, and/or object formats.The
meta
attribute is not used byempress-blog
by default, but it enables developer support for adding metadata to authors, content, pages, and tags. The blueprints have been updated such that all generators will add ameta
attribute, making it clear to users that it is supported.Documentation has been updated to mention this feature is available, and some of the default generated content has had different examples of a
meta
attribute added in those markdown files.I am not sure how to test this, however, since the existing
meta-tests
appears to exclusively assert the output of Front Matter attributes rendered to the DOM, and by default themeta
attribute is not rendered byempress-blog
without custom features being added. However, it is clear from running Ember Inspector that the Ember-Data models have correctly parsed each of themeta
examples added by this change.