mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
updates per Georg Brandl:
- Change alteration to docs to express path relative to "configuration directory" and not "conf.py" - Update block in HTML builder copying favicon to _static to mirror handling of html_logo
This commit is contained in:
parent
549b176c85
commit
3c0c9cd198
@ -497,9 +497,9 @@ that use Sphinx' HTMLWriter class.
|
||||
.. confval:: html_logo
|
||||
|
||||
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``.
|
||||
:term:`configuration directory`) 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
|
||||
@ -508,7 +508,7 @@ that use Sphinx' HTMLWriter class.
|
||||
.. confval:: html_favicon
|
||||
|
||||
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
|
||||
:term:`configuration directory`) 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``.
|
||||
|
||||
|
@ -597,7 +597,7 @@ 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(path.realpath(self.config.html_logo)):
|
||||
if not path.isfile(path.join(self.confdir, 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),
|
||||
@ -605,7 +605,9 @@ class StandaloneHTMLBuilder(Builder):
|
||||
if self.config.html_favicon:
|
||||
iconbase = path.basename(self.config.html_favicon)
|
||||
icontarget = path.join(self.outdir, '_static', iconbase)
|
||||
if not path.isfile(icontarget):
|
||||
if not path.isfile(path.join(self.confdir, self.config.html_favicon)):
|
||||
self.warn('favicon file %r does not exist' % self.config.html_favicon)
|
||||
elif not path.isfile(icontarget):
|
||||
copyfile(path.join(self.confdir, self.config.html_favicon),
|
||||
icontarget)
|
||||
self.info('done')
|
||||
|
Loading…
Reference in New Issue
Block a user