Fix #4811: The files under html_static_path are excluded from source

This commit is contained in:
Takeshi KOMIYA 2018-04-27 22:23:59 +09:00
parent ec76f9cd47
commit cbf4ee24f9
6 changed files with 16 additions and 3 deletions

View File

@ -26,6 +26,8 @@ Incompatible changes
* ``docutils.conf`` on ``$HOME`` and ``/etc`` directories are ignored. Only
``docutils.conf`` on confdir is refered.
* #789: ``:samp:`` role supports to escape curly braces with backslash
* #4811: The files under :confval:`html_static_path` are excluded from source
files.
Deprecated
----------

View File

@ -883,6 +883,9 @@ that use Sphinx's HTMLWriter class.
named :file:`default.css` will overwrite the theme's
:file:`default.css`.
As these files are not meant to be built, they are automatically excluded
from source files.
.. note::
For security reason, dotfiles under ``html_static_path`` will
@ -901,6 +904,10 @@ that use Sphinx's HTMLWriter class.
.. versionchanged:: 1.0
The entries in :confval:`html_static_path` can now be single files.
.. versionchanged:: 1.8
The files under :confval:`html_static_path` are excluded from source
files.
.. confval:: html_extra_path
A list of paths that contain extra files not directly related to
@ -909,8 +916,8 @@ that use Sphinx's HTMLWriter class.
directory. They are copied to the output directory. They will
overwrite any existing file of the same name.
As these files are not meant to be built, they are automatically added to
:confval:`exclude_patterns`.
As these files are not meant to be built, they are automatically excluded
from source files.
.. versionadded:: 1.2

View File

@ -411,7 +411,7 @@ class StandaloneHTMLBuilder(Builder):
def get_asset_paths(self):
# type: () -> List[unicode]
return self.config.html_extra_path
return self.config.html_extra_path + self.config.html_static_path
def render_partial(self, node):
# type: (nodes.Nodes) -> Dict[unicode, unicode]

View File

@ -1089,6 +1089,10 @@ def test_enumerable_node(app, cached_etree_parse, fname, expect):
def test_html_assets(app):
app.builder.build_all()
# exclude_path and its family
assert not (app.outdir / 'static' / 'index.html').exists()
assert not (app.outdir / 'extra' / 'index.html').exists()
# html_static_path
assert not (app.outdir / '_static' / '.htaccess').exists()
assert not (app.outdir / '_static' / '.htpasswd').exists()