diff options
| author | 2014-06-13 21:51:02 -0300 | |
|---|---|---|
| committer | 2014-06-13 21:51:02 -0300 | |
| commit | 58c4878526dec5510f23c812274686787d8724ba (patch) | |
| tree | 5f2374bc17adb10e15f7e5b4576595d9cc2ef17e /nikola/plugins/task/posts.py | |
| parent | fa50632a9d87c3989566fed3e49c160a132e0d14 (diff) | |
Imported Upstream version 7.0.1upstream/7.0.1
Diffstat (limited to 'nikola/plugins/task/posts.py')
| -rw-r--r-- | nikola/plugins/task/posts.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/nikola/plugins/task/posts.py b/nikola/plugins/task/posts.py index a502b81..8e03122 100644 --- a/nikola/plugins/task/posts.py +++ b/nikola/plugins/task/posts.py @@ -25,12 +25,20 @@ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from copy import copy -import nikola.post from nikola.plugin_categories import Task from nikola import utils +def rest_deps(post, task): + """Add extra_deps from ReST into task. + + The .dep file is created by ReST so not available before the task starts + to execute. + """ + task.file_dep.update(post.extra_deps()) + + class RenderPosts(Task): """Build HTML fragments from metadata and text.""" @@ -43,10 +51,10 @@ class RenderPosts(Task): "translations": self.site.config["TRANSLATIONS"], "timeline": self.site.timeline, "default_lang": self.site.config["DEFAULT_LANG"], - "hide_untranslated_posts": self.site.config['HIDE_UNTRANSLATED_POSTS'], + "show_untranslated_posts": self.site.config['SHOW_UNTRANSLATED_POSTS'], + "demote_headers": self.site.config['DEMOTE_HEADERS'], } - nikola.post.READ_MORE_LINK = self.site.config['READ_MORE_LINK'] yield self.group_task() for lang in kw["translations"]: @@ -59,7 +67,9 @@ class RenderPosts(Task): 'name': dest, 'file_dep': post.fragment_deps(lang), 'targets': [dest], - 'actions': [(post.compile, (lang, ))], + 'actions': [(post.compile, (lang, )), + (rest_deps, (post,)), + ], 'clean': True, 'uptodate': [utils.config_changed(deps_dict)], } |
