Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAVIGATION_ALT_LINKS does not keep element order #3261

Closed
angelgcuartero opened this issue May 26, 2019 · 1 comment
Closed

NAVIGATION_ALT_LINKS does not keep element order #3261

angelgcuartero opened this issue May 26, 2019 · 1 comment
Labels

Comments

@angelgcuartero
Copy link

Environment

Python Version:
Python 3.7.3

Nikola Version:
Nikola v8.0.2

Operating System:
macOS 10.13.6 (High Sierra)

Description:

I was trying to configure NAVIGATION_ALT_LINKS and found that the element order was shown different almost everytime I saved conf.py. I had no problems with NAVIGATION_LINKS, so I created a new site for expermentation and found that default conf.py has this:

NAVIGATION_LINKS = {
    DEFAULT_LANG: (
        ("/archive.html", "Archive"),
        ("/categories/", "Tags"),
        ("/rss.xml", "RSS feed"),
    ),
}

NAVIGATION_ALT_LINKS = {
    DEFAULT_LANG: {}
}

DEFAULT_LANG is created as a tuple in NAVIGATION_LINKS, so it keeps the element order and as a dictionary in NAVIGATION_ALT_LINKS. Dictionaries don't keep the element order. Maybe it's enough to change the code in line 91-93 in conf.py.in to

NAVIGATION_ALT_LINKS = {
    DEFAULT_LANG: ()
}

because it does not perform any variable substitution.

@Kwpolska
Copy link
Member

Good catch. I made it into a tuple by default, in commit 6b41c11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants