mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
address issue #1352 -- make sure to check for the actual file stored in config.html_logo.
This commit is contained in:
@@ -496,22 +496,25 @@ that use Sphinx' HTMLWriter class.
|
|||||||
|
|
||||||
.. confval:: html_logo
|
.. confval:: html_logo
|
||||||
|
|
||||||
If given, this must be the name of an image file that is the logo of the
|
If given, this must be the name of an image file (path relative to the
|
||||||
docs. It is placed at the top of the sidebar; its width should therefore not
|
``conf.py`` file) that is the logo of the docs. It is placed at the top of
|
||||||
exceed 200 pixels. Default: ``None``.
|
the sidebar; its width should therefore not exceed 200 pixels. Default:
|
||||||
|
``None``.
|
||||||
|
|
||||||
.. versionadded:: 0.4.1
|
.. versionadded:: 0.4.1
|
||||||
The image file will be copied to the ``_static`` directory of the output
|
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
|
.. confval:: html_favicon
|
||||||
|
|
||||||
If given, this must be the name of an image file (within the static path, see
|
If given, this must be the name of an image file (path relative to the
|
||||||
below) that is the favicon of the docs. Modern browsers use this as icon for
|
``conf.py`` file) that is the favicon of the docs. Modern browsers use this
|
||||||
tabs, windows and bookmarks. It should be a Windows-style icon file
|
as icon for tabs, windows and bookmarks. It should be a Windows-style icon
|
||||||
(``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``.
|
file (``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``.
|
||||||
|
|
||||||
.. versionadded:: 0.4
|
.. 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
|
.. confval:: html_static_path
|
||||||
|
|
||||||
|
|||||||
@@ -597,8 +597,8 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
if self.config.html_logo:
|
if self.config.html_logo:
|
||||||
logobase = path.basename(self.config.html_logo)
|
logobase = path.basename(self.config.html_logo)
|
||||||
logotarget = path.join(self.outdir, '_static', logobase)
|
logotarget = path.join(self.outdir, '_static', logobase)
|
||||||
if not path.isfile(logobase):
|
if not path.isfile(path.realpath(self.config.html_logo)):
|
||||||
self.warn('logo file %r does not exist' % logobase)
|
self.warn('logo file %r does not exist' % self.config.html_logo)
|
||||||
elif not path.isfile(logotarget):
|
elif not path.isfile(logotarget):
|
||||||
copyfile(path.join(self.confdir, self.config.html_logo),
|
copyfile(path.join(self.confdir, self.config.html_logo),
|
||||||
logotarget)
|
logotarget)
|
||||||
|
|||||||
Reference in New Issue
Block a user