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

Customizeable <head> tags #45

Open
AustinGil opened this issue Sep 12, 2021 · 4 comments
Open

Customizeable <head> tags #45

AustinGil opened this issue Sep 12, 2021 · 4 comments

Comments

@AustinGil
Copy link

It would be really nice to be able to add tags to the . In my case, I'd really want open graph stuff, but I could also see it useful for analytics or other things. So far, my favorite approach of offering customization options is how Nuxt allows it:

https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-head

@SaraVieira
Copy link
Owner

Heey!

This has now been published in version 0.11.0. I use a very similar approach that I got from react helmet :)

Also added it to the readme :)

content is required but a lot of tags are already added by default so it should be enough

You can see the code here:

https://github.com/SaraVieira/fiddly/blob/master/src/utils/head.js

@AustinGil
Copy link
Author

OK. I just saw the meta option. Looks good 🗡️

Would it be possible to allow link tags as well? That would support things like custom Google Fonts?

@SaraVieira
Copy link
Owner

Done in v0.12.0: https://github.com/SaraVieira/fiddly#options

It now allows for remoteStyles and remoteScripts in the options where you can pass an array of JS or CSS file links, like so:

{
 "remoteStyles": ["https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap"]
}

Let me know what you think :)

@AustinGil
Copy link
Author

Yeah, I think this would cover most use cases. I know it doesn't always make sense to open things up too much. Defeats the purpose of a tool like that that's intended to make things simple.

My only question is why add remoteStyles and remoteScripts like this and not just a links array like the meta option?

Sorry to keep coming up with more work, but with a more generic link you could do <link rel="canonical" href="https://bedrocss.austingil.com">.

I'm just comparing all the head tags I try to include in my own side projects.

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

No branches or pull requests

2 participants