diff options
| author | 2015-08-26 07:57:04 -0300 | |
|---|---|---|
| committer | 2015-08-26 07:57:04 -0300 | |
| commit | 8041475aab2b8efad7d2857027331bd626d26312 (patch) | |
| tree | 3980e1763c067079a4cebb425d642ca9eac834bf /nikola/plugins/task/posts.py | |
| parent | b0b24795b24ee6809397fbbadf42f31f310a219f (diff) | |
Imported Upstream version 7.6.4
Diffstat (limited to 'nikola/plugins/task/posts.py')
| -rw-r--r-- | nikola/plugins/task/posts.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nikola/plugins/task/posts.py b/nikola/plugins/task/posts.py index d3f17fd..a3a8375 100644 --- a/nikola/plugins/task/posts.py +++ b/nikola/plugins/task/posts.py @@ -24,6 +24,8 @@ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +"""Build HTML fragments from metadata and text.""" + from copy import copy import os @@ -32,7 +34,7 @@ from nikola import filters, utils def update_deps(post, lang, task): - """Updates file dependencies as they might have been updated during compilation. + """Update file dependencies as they might have been updated during compilation. This is done for example by the ReST page compiler, which writes its dependencies into a .dep file. This file is read and incorporated when calling @@ -42,6 +44,7 @@ def update_deps(post, lang, task): class RenderPosts(Task): + """Build HTML fragments from metadata and text.""" name = "render_posts" @@ -74,7 +77,11 @@ class RenderPosts(Task): deps_dict = copy(kw) deps_dict.pop('timeline') for post in kw['timeline']: - + # Extra config dependencies picked from config + for p in post.fragment_deps(lang): + if p.startswith('####MAGIC####CONFIG:'): + k = p.split('####MAGIC####CONFIG:', 1)[-1] + deps_dict[k] = self.site.config.get(k) dest = post.translated_base_path(lang) file_dep = [p for p in post.fragment_deps(lang) if not p.startswith("####MAGIC####")] task = { @@ -110,6 +117,7 @@ class RenderPosts(Task): yield utils.apply_filters(task, {os.path.splitext(dest): flist}) def dependence_on_timeline(self, post, lang): + """Check if a post depends on the timeline.""" if "####MAGIC####TIMELINE" not in post.fragment_deps(lang): return True # No dependency on timeline elif self.tl_changed: |
