summaryrefslogtreecommitdiff
path: root/sphinx/environment/collectors/asset.py
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2019-06-03 16:25:20 +0300
committerDmitry Shachnev <mitya57@gmail.com>2019-06-03 19:37:21 +0300
commit6fc8873087ce38f1a4217ca8d5dc2beaf0c32cda (patch)
treef4ae530a815f54ae2994d8983ce973a3ba5f957f /sphinx/environment/collectors/asset.py
parent127d4db0d4df1a6f80b25dc6f9c80d74216e0070 (diff)
downloadsphinx-git-6fc8873087ce38f1a4217ca8d5dc2beaf0c32cda.tar.gz
Make generated download links reproducible
Without this change the hexdigest generated in DownloadFiles.add_file() depends on source_dir, while just the path fragment relative to it is sufficient.
Diffstat (limited to 'sphinx/environment/collectors/asset.py')
-rw-r--r--sphinx/environment/collectors/asset.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/environment/collectors/asset.py b/sphinx/environment/collectors/asset.py
index 572dea7a4..fed8280c1 100644
--- a/sphinx/environment/collectors/asset.py
+++ b/sphinx/environment/collectors/asset.py
@@ -137,7 +137,7 @@ class DownloadFileCollector(EnvironmentCollector):
logger.warning(__('download file not readable: %s') % filename,
location=node, type='download', subtype='not_readable')
continue
- node['filename'] = app.env.dlfiles.add_file(app.env.docname, filename)
+ node['filename'] = app.env.dlfiles.add_file(app.env.docname, rel_filename)
def setup(app):