Skip to content
Permalink
Browse files

Fix #216 -- fix default value for a navstories config variable

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 15, 2017
1 parent b82395b commit 774d3eb577ef3b3a3ccf2a93990aac4da5bd34e6
Showing with 5 additions and 2 deletions.
  1. +2 −0 v7/navstories/README.md
  2. +1 −1 v7/navstories/navstories.plugin
  3. +2 −1 v7/navstories/navstories.py
@@ -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: (
),
}
```

@@ -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.
@@ -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
@@ -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

0 comments on commit 774d3eb

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