mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4811: The files under html_static_path are excluded from source
This commit is contained in:
parent
ec76f9cd47
commit
cbf4ee24f9
2
CHANGES
2
CHANGES
@ -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
|
||||
----------
|
||||
|
@ -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
|
||||
|
||||
|
@ -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]
|
||||
|
0
tests/roots/test-html_assets/extra/index.rst
Normal file
0
tests/roots/test-html_assets/extra/index.rst
Normal file
0
tests/roots/test-html_assets/static/index.rst
Normal file
0
tests/roots/test-html_assets/static/index.rst
Normal 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()
|
||||
|
Loading…
Reference in New Issue
Block a user