Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elwayman02
Copy link
Contributor

@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 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.

@elwayman02
Copy link
Contributor Author

Screenshots from testing the meta examples via the deploy preview can be found below.

Author:
DevTools_-_deploy-preview-103--empress-blog_netlify_app_page_chris-manson

Content:
DevTools_-_deploy-preview-103--empress-blog_netlify_app_page_chris-manson

Page:
DevTools_-_deploy-preview-103--empress-blog_netlify_app_page_chris-manson

Tag:
DevTools_-_deploy-preview-103--empress-blog_netlify_app_page_chris-manson

@elwayman02 elwayman02 mentioned this pull request Jan 23, 2021
Copy link
Member

@mansona mansona left a 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)

@elwayman02
Copy link
Contributor Author

@mansona I've addressed or responded to all the comments. Can you do another pass?

@elwayman02
Copy link
Contributor Author

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.
@mansona mansona changed the title Allow Arbitrary Metadata for All Content Document Arbitrary Metadata for All Content Sep 9, 2021
@mansona
Copy link
Member

mansona commented Sep 9, 2021

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 😂 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants