Skip to content
Permalink
Browse files

Improved some more plugins.

  • Loading branch information
felixfontein committed Nov 27, 2016
1 parent cf19dc2 commit 0bb4a84b5b86ad97506efb1d4710f416e6311cee
Showing with 6 additions and 12 deletions.
  1. +1 −7 nikola/plugins/task/indexes.py
  2. +2 −2 nikola/plugins/task/page_index.py
  3. +3 −3 nikola/plugins/task/sections.py
@@ -24,7 +24,7 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""Render the blog indexes."""
"""Render the blog's main index."""

from __future__ import unicode_literals

@@ -92,9 +92,3 @@ def provide_context_and_uptodate(self, classification, lang):
}
kw.update(context)
return context, kw

def postprocess_posts_per_classification(self, posts_per_classification_per_language, flat_hierarchy_per_lang=None, hierarchy_lookup_per_lang=None):
"""Rearrange, modify or otherwise use the list of posts per classification and per language."""
for lang, posts_per_classification in posts_per_classification_per_language.items():
if len(posts_per_classification) == 0:
posts_per_classification[""] = []
@@ -24,15 +24,15 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""Render the blog indexes."""
"""Render the page index."""

from __future__ import unicode_literals

from nikola.plugin_categories import Taxonomy


class PageIndex(Taxonomy):
"""Render the page index."""
"""Classify for the page index."""

name = "classify_page_index"

@@ -87,14 +87,14 @@ def provide_context_and_uptodate(self, section, lang):
kw = {
"messages": self.site.MESSAGES,
}
section_name = self._get_Section_name(section, lang)
section_name = self._get_section_name(section, lang)
# Compose section title
section_title = section_name
posts_section_title = self.site.config['POSTS_SECTION_TITLE'](lang)
if type(posts_section_title) is dict:
if isinstance(posts_section_title, dict):
if section in posts_section_title:
section_title = posts_section_title[section]
elif type(posts_section_title) is str:
elif isinstance(posts_section_title, utils.bytes_str, utils.unicode_str):
section_title = posts_section_title
section_title = section_title.format(name=section_name)
# Compose context

0 comments on commit 0bb4a84

Please sign in to comment.
You can’t perform that action at this time.