Skip to content

Commit

Permalink
Fixed #1833.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jun 18, 2015
1 parent c51d8c3 commit d93e32b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions nikola/plugins/task/archive.py
Expand Up @@ -24,6 +24,7 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import copy
import os

# for tearDown with _reload we cannot use 'import from' to access LocaleBorg
Expand Down Expand Up @@ -72,7 +73,7 @@ def _prepare_task(self, kw, name, lang, posts, items, template_name,
context,
)

task_cfg = {1: kw, 2: n}
task_cfg = {1: copy.copy(kw), 2: n}
if deps_translatable is not None:
task_cfg[3] = deps_translatable
task['uptodate'] = task['uptodate'] + [config_changed(task_cfg, 'nikola.plugins.task.archive')]
Expand Down Expand Up @@ -144,11 +145,7 @@ def gen_tasks(self):
# if we are creating one single archive, or full archives
archdata[None] = self.site.posts # for create_single_archive

years = list(archdata.keys())
years.sort() # Issue #1833
for year in years:
posts = archdata[year]

for year, posts in archdata.items():
# Filter untranslated posts (Issue #1360)
if not kw["show_untranslated_posts"]:
posts = [p for p in posts if lang in p.translated_to]
Expand Down Expand Up @@ -204,6 +201,8 @@ def gen_tasks(self):

if not kw['create_single_archive'] and not kw['create_full_archives']:
# And an "all your years" page for yearly and monthly archives
if "is_feed_stale" in kw:
del kw["is_feed_stale"]
years = list(self.site.posts_per_year.keys())
years.sort(reverse=True)
kw['years'] = years
Expand Down

0 comments on commit d93e32b

Please sign in to comment.