-
Notifications
You must be signed in to change notification settings - Fork 73
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 arbitrary permalink attributes #63
Conversation
@nagaozen not sure if you saw this, but what do you think? |
I'm not sure if this is the right approach to the problem. Could you imagine another use case for this option? Otherwise we could just observe for permalink href and inject aria attributes automatically |
There are lots of HTML and ARIA attributes that devs might want to set on the link. For example: Injecting the |
So, I believe that we are looking for a function which also receives (slug, state) and returns an object used to populate custom attributes to the anchor... could you fix the PR to receive a function instead an object? This way the behaviour is far more dynamic and the option becomes more useful. |
I agree, that's a great idea, I'll add it asap. Would you just support a function, or could we fallback to an object for the simple case where a dev just wants to set (for example) a static label? |
I believe just a function is better, no need to overload the option. We must try to keep it simple and coherent with the other options |
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.
PR is ready to merge
As discussed in #62, it would be nice to give the user the ability to set extra HTML attributes on the permalink anchor.
permalinkAttrs
object toopts
that sets all key/value pairs at attributes