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

Favicon in assets folder ignored #195

Closed
lcontento opened this issue Jan 8, 2025 · 1 comment · Fixed by #197
Closed

Favicon in assets folder ignored #195

lcontento opened this issue Jan 8, 2025 · 1 comment · Fixed by #197

Comments

@lcontento
Copy link

I have put a favicon.ico in the src/assets folder but it is not picked up by Vitepress, in the sense that the resulting HTML has no <link rel="icon" href="/favicon.ico"> line.

If I look in the build log I see

Warning: DocumenterVitepress: No favicon.ico file found in `docs/src/assets`.  Skipping favicon replacement.

However, if I look at the source of modify_config_file (which raises the warning), I see that it checks whether a favicon is present in the public subfolder. If no such file is present then the favicon setting is removed from the configuration file.

Looking at the render function I see some code that moves favicons and logos from the assets subfolder to the public subfolder, but that code is run AFTER the call to modify_config_file. If exchange the order of the two code blocks (see lcontento@e562718) then the resulting HTML contains the favicon link. This is still not enough to display the favicon though because of #141, but then it's just a matter of moving it manually to the root folder.

Since I am new to Vitepress I am not sure if my (partial) fix is the correct one or not, or even if I am right in putting the favicon.ico into the assets subfolder in the first place like it is done for vanilla Documenter, but if you think my approach is correct I can open a PR with it.

@lazarusA
Copy link
Collaborator

lazarusA commented Jan 10, 2025

a PR would be helpful 😄 .

Edit: no need. I just pushed a fix.

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

Successfully merging a pull request may close this issue.

2 participants