Skip to content

Commit

Permalink
Fix #216 -- fix default value for a navstories config variable
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 15, 2017
1 parent b82395b commit 774d3eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions v7/navstories/README.md
Expand Up @@ -41,6 +41,8 @@ NAVSTORIES_SUBMENU_INDENTION = '* '
# Static menu after dynamic navstories menu entries
# Format just as NAVIGATION_LINKS, but content included after navstories entries
NAVIGATION_LINKS_POST_NAVSTORIES = {
DEFAULT_LANG: (
),
}
```

Expand Down
2 changes: 1 addition & 1 deletion v7/navstories/navstories.plugin
Expand Up @@ -8,6 +8,6 @@ MinVersion = 7.1.0+

[Documentation]
Author = Chris Warrick, Benny Simonsen
Version = 1.0.1
Version = 1.0.2
Website = http://plugins.getnikola.com/#navstories
Description = Add all stories in specified locations to the navigation bar.
3 changes: 2 additions & 1 deletion v7/navstories/navstories.py
Expand Up @@ -39,6 +39,7 @@ class NavStories(ConfigPlugin):
dates = {}

conf_vars = ['TRANSLATIONS', 'NAVSTORIES_PATHS', 'NAVSTORIES_MAPPING', 'NAVIGATION_LINKS_POST_NAVSTORIES']
conf_defaults = {'TRANSLATIONS': dict, 'NAVSTORIES_PATHS': dict, 'NAVSTORIES_MAPPING': dict, 'NAVIGATION_LINKS_POST_NAVSTORIES': tuple}

# Indention for each level deeper in a submenu, than the highest level in that submenu
# overwriiten by site.config['NAVSTORIES_SUBMENU_INDENTION'] if defined
Expand Down Expand Up @@ -130,7 +131,7 @@ def set_site(self, site):
nav_config[i] = utils.TranslatableSetting(i, site.config[i], site.config['TRANSLATIONS'])
except KeyError:
# Initialize to "empty" in case config variable i is missing
nav_config[i] = utils.TranslatableSetting(i, {}, site.config['TRANSLATIONS'])
nav_config[i] = utils.TranslatableSetting(i, self.conf_defaults[i](), site.config['TRANSLATIONS'])

site.scan_posts()
# NAVIGATION_LINKS is a TranslatableSetting, values is an actual dict
Expand Down

0 comments on commit 774d3eb

Please sign in to comment.