Skip to content

Commit 6ed991e

Browse files
authoredMar 17, 2017
Merge pull request #217 from getnikola/navstories-216
Fix #216 -- fix default value for a navstories config variable
2 parents b357cc9 + 774d3eb commit 6ed991e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
 

‎v7/navstories/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ NAVSTORIES_SUBMENU_INDENTION = '* '
4141
# Static menu after dynamic navstories menu entries
4242
# Format just as NAVIGATION_LINKS, but content included after navstories entries
4343
NAVIGATION_LINKS_POST_NAVSTORIES = {
44+
DEFAULT_LANG: (
45+
),
4446
}
4547
```
4648

‎v7/navstories/navstories.plugin

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ MinVersion = 7.1.0+
88

99
[Documentation]
1010
Author = Chris Warrick, Benny Simonsen
11-
Version = 1.0.1
11+
Version = 1.0.2
1212
Website = http://plugins.getnikola.com/#navstories
1313
Description = Add all stories in specified locations to the navigation bar.

‎v7/navstories/navstories.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class NavStories(ConfigPlugin):
3939
dates = {}
4040

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

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

135136
site.scan_posts()
136137
# NAVIGATION_LINKS is a TranslatableSetting, values is an actual dict

0 commit comments

Comments
 (0)
Please sign in to comment.