Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ffa45f1

Browse files
committedMay 23, 2017
Fixing name to other_languages.
1 parent 46de7ef commit ffa45f1

8 files changed

+31
-31
lines changed
 

‎docs/template-variables.rst

+17-17
Original file line numberDiff line numberDiff line change
@@ -247,29 +247,29 @@ Classification pages (lists)
247247

248248
.. class:: table table-bordered table-striped
249249

250-
================================== ============== =============================================================
251-
Name Type Description
252-
================================== ============== =============================================================
253-
``kind`` str The classification name
254-
``items`` list? List of items for ``list.tmpl`` *(title, permalink, None)*
255-
``posts`` list<Post>? List of items for other templates
256-
``kind`` str The classification name
257-
``permalink`` str Permanent link to page
258-
``<other_language_variable_name>`` list<tuple> List of triples ``(other_lang, other_classification, title)``
259-
================================== ============== =============================================================
250+
=================== ============== =============================================================
251+
Name Type Description
252+
=================== ============== =============================================================
253+
``kind`` str The classification name
254+
``items`` list? List of items for ``list.tmpl`` *(title, permalink, None)*
255+
``posts`` list<Post>? List of items for other templates
256+
``kind`` str The classification name
257+
``permalink`` str Permanent link to page
258+
``other_languages`` list<tuple> List of triples ``(other_lang, other_classification, title)``
259+
=================== ============== =============================================================
260260

261261
Subclassification page
262262
~~~~~~~~~~~~~~~~~~~~~~
263263

264264
.. class:: table table-bordered table-striped
265265

266-
================================== =========== =============================================================
267-
Name Type Description
268-
================================== =========== =============================================================
269-
``items`` list? List of items
270-
``permalink`` str Permanent link to page
271-
``<other_language_variable_name>`` list<tuple> List of triples ``(other_lang, other_classification, title)``
272-
================================== =========== =============================================================
266+
=================== =========== =============================================================
267+
Name Type Description
268+
=================== =========== =============================================================
269+
``items`` list? List of items
270+
``permalink`` str Permanent link to page
271+
``other_languages`` list<tuple> List of triples ``(other_lang, other_classification, title)``
272+
=================== =========== =============================================================
273273

274274
Hierarchical lists
275275
~~~~~~~~~~~~~~~~~~

‎nikola/plugin_categories.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,11 @@ class Taxonomy(BasePlugin):
602602
language, or only the classifications for one language in its language's
603603
pages.
604604
605-
other_language_variable_name = None:
606-
In case this is not `None`, each classification page will get a list
605+
add_other_languages_variable = False:
606+
In case this is `True`, each classification page will get a list
607607
of triples `(other_lang, other_classification, title)` of classifications
608-
in other languages which should be linked. The list will be stored in a
609-
variable by the name `other_language_variable_name`.
608+
in other languages which should be linked. The list will be stored in the
609+
variable `other_languages`.
610610
611611
path_handler_docstrings:
612612
A dictionary of docstrings for path handlers. See eg. nikola.py for
@@ -639,7 +639,7 @@ class Taxonomy(BasePlugin):
639639
minimum_post_count_per_classification_in_overview = 1
640640
omit_empty_classifications = False
641641
also_create_classifications_from_other_languages = True
642-
other_language_variable_name = None
642+
add_other_languages_variable = False
643643
path_handler_docstrings = {
644644
'taxonomy_index': '',
645645
'taxonomy': '',

‎nikola/plugins/task/archive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Archive(Taxonomy):
5353
minimum_post_count_per_classification_in_overview = 1
5454
omit_empty_classifications = False
5555
also_create_classifications_from_other_languages = False
56-
other_language_variable_name = 'other_languages'
56+
add_other_languages_variable = True
5757
path_handler_docstrings = {
5858
'archive_index': False,
5959
'archive': """Link to archive path, name is the year.

‎nikola/plugins/task/authors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ClassifyAuthors(Taxonomy):
4848
minimum_post_count_per_classification_in_overview = 1
4949
omit_empty_classifications = False
5050
also_create_classifications_from_other_languages = False
51-
other_language_variable_name = 'other_languages'
51+
add_other_languages_variable = True
5252
path_handler_docstrings = {
5353
'author_index': """ Link to the authors index.
5454

‎nikola/plugins/task/categories.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ClassifyCategories(Taxonomy):
5454
minimum_post_count_per_classification_in_overview = 1
5555
omit_empty_classifications = True
5656
also_create_classifications_from_other_languages = True
57-
other_language_variable_name = 'other_languages'
57+
add_other_languages_variable = True
5858
path_handler_docstrings = {
5959
'category_index': """A link to the category index.
6060

‎nikola/plugins/task/sections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ClassifySections(Taxonomy):
4747
apply_to_pages = False
4848
omit_empty_classifications = True
4949
also_create_classifications_from_other_languages = False
50-
other_language_variable_name = 'other_languages'
50+
add_other_languages_variable = True
5151
path_handler_docstrings = {
5252
'section_index_index': False,
5353
'section_index': """Link to the index for a section.

‎nikola/plugins/task/tags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ClassifyTags(Taxonomy):
5050
apply_to_pages = False
5151
omit_empty_classifications = True
5252
also_create_classifications_from_other_languages = True
53-
other_language_variable_name = 'other_languages'
53+
add_other_languages_variable = True
5454
path_handler_docstrings = {
5555
'tag_index': """A link to the tag index.
5656

‎nikola/plugins/task/taxonomies.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ def _generate_classification_page(self, taxonomy, classification, filtered_posts
348348
taxonomy.get_classification_friendly_name(classification, other_lang))
349349
for classification in links if post_lists_per_lang[other_lang].get(classification, ('', False, False))[1]])
350350
# Store result in context and kw
351-
context[taxonomy.other_language_variable_name] = sorted_links
352-
kw[taxonomy.other_language_variable_name] = sorted_links
351+
context['other_languages'] = sorted_links
352+
kw['other_languages'] = sorted_links
353353
# Allow other plugins to modify the result
354354
blinker.signal('generate_classification_page').send({
355355
'site': self.site,
@@ -385,10 +385,10 @@ def gen_tasks(self):
385385
yield self.group_task()
386386

387387
# Cache classification sets per language for taxonomies where
388-
# other_language_variable_name is set.
388+
# add_other_languages_variable is True.
389389
classification_set_per_lang = {}
390390
for taxonomy in self.site.taxonomy_plugins.values():
391-
if taxonomy.other_language_variable_name is not None:
391+
if taxonomy.add_other_languages_variable:
392392
lookup = self.site.posts_per_classification[taxonomy.classification_name]
393393
cspl = {lang: set(lookup[lang].keys()) for lang in lookup}
394394
classification_set_per_lang[taxonomy.classification_name] = cspl

0 commit comments

Comments
 (0)
Please sign in to comment.