Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add FRONT_INDEX_HEADER setting
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 17, 2016
1 parent 7638ac8 commit eeed825
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CHANGES.txt
@@ -1,3 +1,15 @@
New in v7.7.6
=============

Features
--------

* Add ``FRONT_INDEX_HEADER`` setting to allow adding greeting notices
to the main index page

Bugfixes
--------

New in v7.7.5
=============

Expand Down
6 changes: 6 additions & 0 deletions nikola/conf.py.in
Expand Up @@ -391,6 +391,12 @@ HIDDEN_AUTHORS = ['Guest']
# output / TRANSLATION[lang] / INDEX_PATH / index-*.html
# INDEX_PATH = ""

# Optional HTML that displayed on “main” blog index.html files.
# May be used for a greeting. (translatable)
FRONT_INDEX_HEADER = {
DEFAULT_LANG: ''
}

# Create per-month archives instead of per-year
# CREATE_MONTHLY_ARCHIVE = False
# Create one large archive instead of per-year
Expand Down
3 changes: 3 additions & 0 deletions nikola/data/themes/base/templates/index.tmpl
Expand Up @@ -12,6 +12,9 @@

<%block name="content">
<%block name="content_header"></%block>
% if 'main_index' in pagekind:
${front_index_header}
% endif
<div class="postindex">
% for post in posts:
<article class="h-entry post-${post.meta('type')}">
Expand Down
4 changes: 4 additions & 0 deletions nikola/nikola.py
Expand Up @@ -412,6 +412,7 @@ def __init__(self, **config):
'FILES_FOLDERS': {'files': ''},
'FILTERS': {},
'FORCE_ISO8601': False,
'FRONT_INDEX_HEADER': '',
'GALLERY_FOLDERS': {'galleries': 'galleries'},
'GALLERY_SORT_BY_DATE': True,
'GLOBAL_CONTEXT_FILLER': [],
Expand Down Expand Up @@ -554,6 +555,7 @@ def __init__(self, **config):
'BODY_END',
'EXTRA_HEAD_DATA',
'NAVIGATION_LINKS',
'FRONT_INDEX_HEADER',
'INDEX_READ_MORE_LINK',
'FEED_READ_MORE_LINK',
'INDEXES_TITLE',
Expand Down Expand Up @@ -587,6 +589,7 @@ def __init__(self, **config):
'posts_section_descriptions',
'posts_section_name',
'posts_section_title',
'front_index_header',
)
# WARNING: navigation_links SHOULD NOT be added to the list above.
# Themes ask for [lang] there and we should provide it.
Expand Down Expand Up @@ -954,6 +957,7 @@ def _set_global_context(self):
self._GLOBAL_CONTEXT['show_blog_title'] = self.config.get('SHOW_BLOG_TITLE')
self._GLOBAL_CONTEXT['logo_url'] = self.config.get('LOGO_URL')
self._GLOBAL_CONTEXT['blog_description'] = self.config.get('BLOG_DESCRIPTION')
self._GLOBAL_CONTEXT['front_index_header'] = self.config.get('FRONT_INDEX_HEADER')
self._GLOBAL_CONTEXT['color_hsl_adjust_hex'] = utils.color_hsl_adjust_hex
self._GLOBAL_CONTEXT['colorize_str_from_base_color'] = utils.colorize_str_from_base_color

Expand Down

0 comments on commit eeed825

Please sign in to comment.