fix(seo-meta): rework meta tag mapping #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
n/a
β Type of change
π Description
The new meta tags added in harlan-zw/zhead#18 are not prefixed with
og
. That way, they are not properly added to the head (see first test commit).I observe that keys (
name
orproperty
) us a custom formats:msapplication-TileImage
og:audio:secure_url\
So there is no standard way to format such a key. The html standard keys seem to be all lowercase with dashes, so I kept this as standard formatting.
For all other keys, I propose to extend the
MetaPackingSchema
, dropping the prefix logic that's currently used e.g. for open graph tags as that logic may overlap with future keys (imagine meta information about ogres likeogre:name
π you get the idea).The algorithm I implemented should work for any depth of object nesting.
Please correct me if I could make better use of
packrup
. It's somehow not trivial to grasp right away for myhead
if I could utilize that library better.π Checklist