Skip to content

Commit

Permalink
Add a pagekind to reprenent archives as indexes, which looks a lot be…
Browse files Browse the repository at this point in the history
…tter.
  • Loading branch information
jamadden committed Oct 9, 2017
1 parent 1155070 commit f606bd2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nti/nikola_chameleon/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ class IMainIndexPageKind(IIndexPageKind):
# 'index' and 'main_index' in pagkeind
interface.taggedValue('__pagekinds__', (u'index', u'main_index'))

class IArchiveIndexPageKind(IIndexPageKind,
IArchivePageKind):
"""
When archives are indexes.
ARCHIVES_ARE_INDEXES = True
"""

interface.taggedValue('__pagekinds__', (u'index', u'archive_page'))

class IPostPageKind(IPageKind):
"""A blog post"""

Expand Down Expand Up @@ -138,6 +148,9 @@ def _build(iface, result, tag='__pagekinds__', tx=lambda x: x):
kinds = iface.getTaggedValue(tag)
kinds = tx(kinds)
if kinds in result and kinds: # pragma: no cover
if result[kinds] is iface:
# Multiple inheritance
return
raise ValueError("Duplicate %s" % tag, kinds, iface)

if kinds not in result:
Expand Down

0 comments on commit f606bd2

Please sign in to comment.