-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(metas): add other
tags field
#604
feat(metas): add other
tags field
#604
Conversation
Signed-off-by: Niklas Metje <[email protected]>
Signed-off-by: Niklas Metje <[email protected]>
Signed-off-by: Niklas Metje <[email protected]>
Signed-off-by: Niklas Metje <[email protected]>
After having another look on the |
Thank! Your implementation looks great! The only problem is the For example, if in the root metas:
other:
"twitter:label1": Reading time And you want to customize the value in a nested _data file: metas:
other:
"twitter:data1": 1 minute The complete I can think of different solutions:
metas:
title: "My great blog post"
"twitter:label1": Reading time
"twitter:data1": 1 minute
I guess the solution 1 is the most simple to implement, but I would like to hear your opinion. |
Oh thanks for the feedback. This totally makes sense! I forgot about the merging "only" on the first level. I think extending the interface MetaData {
...
[key: string]: string
} To get it to accept dynamic keys in the type. Based on the stack overflow answer. And then maybe destructure the incoming object to get the non fixed defined keys. I have to try it in the next few days that might be a good idea. Sounds like a first plan to start with. Thanks! |
@niklasmtj Hey there! Have you been able to make any progress in this? No problem if you need more time, just want to know it because I want to release a new Lume version soon and I'd like to include this feature. Or let me know if you are not going to work on this (because reasons) so I can continue your work. |
Hey sorry, had a busy week. We can also collaborate on this! So if you have an idea on how to implement it easily, go forward :) |
@niklasmtj I cannot commit to your PR (obviously) so created this new branch and PR #608 with your commits and additional changes to make the |
Description
This PR adds the possibilty to add custom meta tags via the
metas
plugin. It is possible via theother
attribute in the metas field.An code example:
Which results in:
The background of this PR was adding
twitter:label1
andtwitter:data1
meta tags to use the preview features that are now available to build previews with. It uses thetwitter
prefix but is also available on e.g. Slack.Examples:
X
See
Nomad Score
andNomad Cost
here.Slack
From an implementation point of view I took the way that NextJS does it to make them able to add them via the
other
attribute in the metadata fields. See this discussionI'm open for feedback to get this feature landed☺️
Related Issues
none - yet
Check List
CODE OF CONDUCT
CONTRIBUTING
send multiple pull request.
fmt
to fix the code format before commit.CHANGELOG.md
.