Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improved some more plugins.
  • Loading branch information
felixfontein committed Nov 27, 2016
1 parent cf19dc2 commit 0bb4a84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions nikola/plugins/task/indexes.py
Expand Up @@ -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

Expand Down Expand Up @@ -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[""] = []
4 changes: 2 additions & 2 deletions nikola/plugins/task/page_index.py
Expand Up @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions nikola/plugins/task/sections.py
Expand Up @@ -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
Expand Down

0 comments on commit 0bb4a84

Please sign in to comment.