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

How do you require the favicon? #118

Closed
semyou opened this issue Nov 1, 2019 · 5 comments
Closed

How do you require the favicon? #118

semyou opened this issue Nov 1, 2019 · 5 comments

Comments

@semyou
Copy link

semyou commented Nov 1, 2019

Hi,

How do you recommend we require the favicon in the header. Right now we have an entry in the HEAD:

@cyrilwanner
Copy link
Owner

If you are referring to .ico files, please read this section in the readme: https://github.com/cyrilwanner/next-optimized-images#handleimages (next to the ℹ️). After you have enabled those file, you can import them the same way as other images.

@semyou
Copy link
Author

semyou commented Nov 1, 2019

@cyrilwanner - will it work even if importing a favicon is done like this?
<link rel="icon" href="favicon.ico" type="image/x-icon" />

@cyrilwanner
Copy link
Owner

I think sharing the code didn't work, at least I can't see anything.

@semyou
Copy link
Author

semyou commented Nov 1, 2019

Now added the code brackets @cyrilwanner

@cyrilwanner
Copy link
Owner

You have to import the favicon like every other image, so you could do it like this (or using an import at the top of the file):

<link rel="icon" href={require('./yourpath/favicon.ico')} type="image/x-icon" />

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