Skip to content

Commit

Permalink
Made INDEXES_PRETTY_PAGE_URL translatable with existing machinery.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Dec 30, 2014
1 parent d1f2287 commit bbbc171
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion nikola/nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ def __init__(self, **config):
'INDEX_READ_MORE_LINK',
'RSS_READ_MORE_LINK',
'INDEXES_TITLE',
'INDEXES_PAGES',)
'INDEXES_PAGES',
'INDEXES_PRETTY_PAGE_URL',)

self._GLOBAL_CONTEXT_TRANSLATABLE = ('blog_author',
'blog_title',
Expand Down
8 changes: 3 additions & 5 deletions nikola/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,9 @@ def adjust_name_for_index_path_list(path_list, i, displayed_i, lang, site, force
elif len(path_list) == 0 or not path_list[-1].endswith(extension):
path_list.append(index_file)
if site.config["PRETTY_URLS"] and site.config["INDEXES_PRETTY_PAGE_URL"] and path_list[-1] == index_file:
path_schema = site.config["INDEXES_PRETTY_PAGE_URL"]
if type(path_schema) == dict and lang in path_schema:
path_schema = path_schema[lang]
if type(path_schema) not in {list, tuple}:
path_schema = None
path_schema = site.config["INDEXES_PRETTY_PAGE_URL"](lang)
if type(path_schema) == str:
path_schema = [path_schema]
else:
path_schema = None
if path_schema is not None:
Expand Down

0 comments on commit bbbc171

Please sign in to comment.