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

Favicons don't work on github pages with chrome #2317

Closed
IgnatBeresnev opened this issue Jan 19, 2022 · 1 comment · Fixed by #2365
Closed

Favicons don't work on github pages with chrome #2317

IgnatBeresnev opened this issue Jan 19, 2022 · 1 comment · Fixed by #2365
Labels

Comments

@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Jan 19, 2022

Dokka hosted on github pages does not have any favicon icons in Chrome. Examples: coroutines and serialization. This question was brought up here

This seems to be an issue specific to GH pages (as many other people on SO are having the same problem) + Chrome (it works perfectly with firefox), but hopefully this issue can be used to collect information

What I tried and it didn't work:

  • Appending ? to the svg icon path (both for current one and the one hosted separately)
  • Hosting the svg icon separately and providing the full path
  • Adding data directly does not help: <link href="data:image/x-icon;base64,AAABAAEAEBAQAAE..." rel="icon" type="image/x-icon">
  • Uploading logo-icon.ico adding it as <link rel="shortcut icon" type="image/x-icon" href="https://gh-pages.com/full/path/logo-icon.ico">

There are various other workarounds that can be tried, but I didn't have the time.

Observations:

  • it only doesn't work for subpages. If you go to the main page, the favicon is there. Example here
  • if you open the console, you'll see that chrome tries to find the favicon in the root:
GET https://ignatberesnev.github.io/favicon.ico 404
  • Some of the methods that I tried above worked for various people, but didn't work for me, so that might be a problem on my end?

Dokka: 1.6.10
Chrome: Version 97.0.4692.71 (Official Build) (64-bit) Linux

@vmishenev
Copy link
Member

This is known. #1830 (comment)
You can take a look at html code from pages of coroutines or serialization (any multimodule project):

  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>kotlinx-coroutines-core</title>
</head><body><link href="../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../";</script>
....

head-tag ended at unexpected place. It shoud be after link and scripts tags.
I will able to fix it after my vacation.

@vmishenev vmishenev linked a pull request Feb 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants