aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/task/posts.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
commit475d074fd74425efbe783fad08f97f2df0c4909f (patch)
tree2acdae53999b3c74b716efa4edb5b40311fa356a /nikola/plugins/task/posts.py
parentcd502d52787f666fff3254d7d7e7578930c813c2 (diff)
parent3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (diff)
Update upstream source from tag 'upstream/8.1.2'
Update to upstream version '8.1.2' with Debian dir e5e966a9e6010ef70618dc9a61558fa4db35aceb
Diffstat (limited to 'nikola/plugins/task/posts.py')
-rw-r--r--nikola/plugins/task/posts.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/nikola/plugins/task/posts.py b/nikola/plugins/task/posts.py
index fe10c5f..5f48165 100644
--- a/nikola/plugins/task/posts.py
+++ b/nikola/plugins/task/posts.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2016 Roberto Alsina and others.
+# Copyright © 2012-2020 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -26,11 +26,11 @@
"""Build HTML fragments from metadata and text."""
-from copy import copy
import os
+from copy import copy
from nikola.plugin_categories import Task
-from nikola import filters, utils
+from nikola import utils
def update_deps(post, lang, task):
@@ -85,11 +85,12 @@ class RenderPosts(Task):
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####")]
+ extra_targets = post.compiler.get_extra_targets(post, lang, dest)
task = {
'basename': self.name,
'name': dest,
'file_dep': file_dep,
- 'targets': [dest],
+ 'targets': [dest] + extra_targets,
'actions': [(post.compile, (lang, )),
(update_deps, (post, lang, )),
],
@@ -107,12 +108,9 @@ class RenderPosts(Task):
for i, f in enumerate(ff):
if not f:
continue
- if f.startswith('filters.'): # A function from the filters module
- f = f[8:]
- try:
- flist.append(getattr(filters, f))
- except AttributeError:
- pass
+ _f = self.site.filters.get(f)
+ if _f is not None: # A registered filter
+ flist.append(_f)
else:
flist.append(f)
yield utils.apply_filters(task, {os.path.splitext(dest)[-1]: flist})