aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/task/posts.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2015-08-26 07:57:23 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2015-08-26 07:57:23 -0300
commit70ceb871117ca811d63cb02671dc0fefc2700883 (patch)
tree846133ea39797d2cd1101cff2ac0818167353490 /nikola/plugins/task/posts.py
parent8559119e2f45b7f6508282962c0430423bfab051 (diff)
parent787b97a4cb24330b36f11297c6d3a7a473a907d0 (diff)
Merge tag 'upstream/7.6.4'
Upstream version 7.6.4
Diffstat (limited to 'nikola/plugins/task/posts.py')
-rw-r--r--nikola/plugins/task/posts.py12
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: