mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Allow subdirs in html_static_path.
This commit is contained in:
parent
5eaf2eb29a
commit
28c3199018
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ New features added
|
|||||||
* The new `exclude_trees` config option can be used to exclude whole
|
* The new `exclude_trees` config option can be used to exclude whole
|
||||||
subtrees from the search for source files.
|
subtrees from the search for source files.
|
||||||
|
|
||||||
|
* The directories in the `html_static_path` can now contain subdirectories.
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -202,6 +202,9 @@ that use Sphinx' HTMLWriter class.
|
|||||||
files, so a file named :file:`default.css` will overwrite the builtin
|
files, so a file named :file:`default.css` will overwrite the builtin
|
||||||
:file:`default.css`.
|
:file:`default.css`.
|
||||||
|
|
||||||
|
.. versionchanged:: 0.4
|
||||||
|
The paths in :confval:`html_static_path` can now contain subdirectories.
|
||||||
|
|
||||||
.. confval:: html_last_updated_fmt
|
.. confval:: html_last_updated_fmt
|
||||||
|
|
||||||
If this is not the empty string, a 'Last updated on:' timestamp is inserted
|
If this is not the empty string, a 'Last updated on:' timestamp is inserted
|
||||||
|
@ -507,8 +507,14 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
for spath in self.config.html_static_path]
|
for spath in self.config.html_static_path]
|
||||||
for staticdirname in staticdirnames:
|
for staticdirname in staticdirnames:
|
||||||
for filename in os.listdir(staticdirname):
|
for filename in os.listdir(staticdirname):
|
||||||
if not filename.startswith('.'):
|
if filename.startswith('.'):
|
||||||
shutil.copyfile(path.join(staticdirname, filename),
|
continue
|
||||||
|
fullname = path.join(staticdirname, filename)
|
||||||
|
if path.isfile(fullname):
|
||||||
|
shutil.copyfile(fullname,
|
||||||
|
path.join(self.outdir, '_static', filename))
|
||||||
|
elif path.isdir(fullname):
|
||||||
|
shutil.copytree(fullname,
|
||||||
path.join(self.outdir, '_static', filename))
|
path.join(self.outdir, '_static', filename))
|
||||||
# add pygments style file
|
# add pygments style file
|
||||||
f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
|
f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
|
||||||
|
Loading…
Reference in New Issue
Block a user