address issue #1352 -- make sure to check for the actual file stored in config.html_logo.

This commit is contained in:
Viktor Haag 2014-01-20 10:37:37 -05:00
parent 8ef6226e31
commit 3706ed02ac
2 changed files with 13 additions and 10 deletions

View File

@ -496,22 +496,25 @@ that use Sphinx' HTMLWriter class.
.. confval:: html_logo
If given, this must be the name of an image file that is the logo of the
docs. It is placed at the top of the sidebar; its width should therefore not
exceed 200 pixels. Default: ``None``.
If given, this must be the name of an image file (path relative to the
``conf.py`` file) that is the logo of the docs. It is placed at the top of
the sidebar; its width should therefore not exceed 200 pixels. Default:
``None``.
.. versionadded:: 0.4.1
The image file will be copied to the ``_static`` directory of the output
HTML, so an already existing file with that name will be overwritten.
HTML, but only if the file does not already exist there.
.. confval:: html_favicon
If given, this must be the name of an image file (within the static path, see
below) that is the favicon of the docs. Modern browsers use this as icon for
tabs, windows and bookmarks. It should be a Windows-style icon file
(``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``.
If given, this must be the name of an image file (path relative to the
``conf.py`` file) that is the favicon of the docs. Modern browsers use this
as icon for tabs, windows and bookmarks. It should be a Windows-style icon
file (``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``.
.. versionadded:: 0.4
The image file will be copied to the ``_static`` directory of the output
HTML, but only if the file does not already exist there.
.. confval:: html_static_path

View File

@ -597,8 +597,8 @@ class StandaloneHTMLBuilder(Builder):
if self.config.html_logo:
logobase = path.basename(self.config.html_logo)
logotarget = path.join(self.outdir, '_static', logobase)
if not path.isfile(logobase):
self.warn('logo file %r does not exist' % logobase)
if not path.isfile(path.realpath(self.config.html_logo)):
self.warn('logo file %r does not exist' % self.config.html_logo)
elif not path.isfile(logotarget):
copyfile(path.join(self.confdir, self.config.html_logo),
logotarget)