favicon.ico location (& right sidebar)

342 views
Skip to first unread message

Paulette

unread,
Dec 1, 2009, 9:31:13 AM12/1/09
to sphinx-dev
Hi,

I created a "favicon.ico" file which I placed in the docs/ directory.
In the conf.py file, I put:

html_favicon = 'favicon.ico'

Before I added my file name for this option, when I built, a generic
favicon (apparently for this particular server) appeared. After
adding the above, I now get a white circle in place of the generic
favicon. I thought maybe my favicon.ico was incorrect. However, when I
place the file in docs/_build/html/_static (on my branch), the favicon
displays correctly.

Should my "favicon.ico" file be in another folder? If so, where?

Also, I used the "html_theme_option" in "conf.py" to put the sidebar
on the right. The sidebar displays and works great in Firefox (except
for a sticky sidebar), but in IE, the toolbar background displays on
the right, but the text & logo that go on it remain on the left.

Thanks for any help.
Paulette

Viktor Haag

unread,
Oct 4, 2012, 9:27:57 AM10/4/12
to sphin...@googlegroups.com
Since earlier this year, Chrome (and perhaps Firefox) have stopped showing favicons in the address field in the browser: however, both browsers seem to be showing the favicon in the top left of the tab containing the page (if you're using tabs). I just tried Safari (under Mountain Lion) on my published docs set, and it's showing the favicon in the address bar. Here are the settings and directories I use.

where I put the "source" for the favicon file --> ProjectDir/.static/favicon.ico
where I have my conf.py ProjectDir/conf.py

in conf.py  --> html_static_path = ['.static', 'img']
in conf.py --> html_favicon = 'favicon.ico'

Notice that your html_static_path list needs to have the names of your -source- static directories, so if you're using a static directory named "_static" in your source tree, then you need to have that name in your html_static_path list. This copies the favicon over to my OutputDir/html/_static/favicon.ico.

And puts this into my output html, in the <head>:

   <link rel='shortcut icon' href='_static/favicon.ico'/>

From there, any browser that pays attention to the favicon should find it. If you have all those settings correctly aligned and your browsers are still not showing the favicon, then "something else is wrong".

--
Viktor

On Monday, 1 October 2012 22:34:02 UTC-4, Michelle Wetzler wrote:
Hi -
I am also having problems with the favicon file. 
I stored mine in a source/_static folder and set html_favicon = 'favicon.ico' 
I saw that after doing "make clean html", I found favicon.ico in the build/_static/ folder. So that part seems to work fine.

However, the icon does not appear in Chrome or Safari :(
I haven't tried FF or IE.

- Michelle

Monami Bhattacharya

unread,
May 6, 2015, 7:54:14 AM5/6/15
to sphinx...@googlegroups.com, sphin...@googlegroups.com
Thanks, Viktor. Tried this today and worked perfectly for me.

Wondering if there's a way to override the fa home icon and use a custom image instead ...?

-M 
Reply all
Reply to author
Forward
0 new messages