Skip to content

Commit

Permalink
Document NAVIGATION_ALT_LINKS
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2018
1 parent 9d3293b commit 33361bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/creating-a-theme.rst
Expand Up @@ -355,7 +355,7 @@ all the interesting stuff:
That link which says "Skip to main content" is very important for accessibility, so we will leave it in
place. But below, you can see how it creates the "container" div we see in the Nikola page, and the content is
created by ``html_header()`` which is defined in ``base_header.tmpl`` The actual ``nav`` element is done
by the ``html_navigation_links`` function out of the ``NAVIGATION_LINKS`` option.
by the ``html_navigation_links`` function out of the ``NAVIGATION_LINKS`` and ``NAVIGATION_ALT_LINKS`` options. (Let's put the alt links after regular ones; Bootstrap puts it on the right side, for example.)

So, first, lets change that base template to be more lanyon-like:

Expand Down Expand Up @@ -433,6 +433,10 @@ Another problem is that the contents of the nav element are wrong. They are not
<a class="sidebar-nav-item" href="${url}">${text}</a>
%endfor
${template_hooks['menu']()}
%for url, text in navigation_alt_links[lang]:
<a class="sidebar-nav-item" href="${url}">${text}</a>
%endfor
${template_hooks['menu_alt']()}
</nav>
</%def>
Expand Down
3 changes: 3 additions & 0 deletions docs/manual.rst
Expand Up @@ -1548,6 +1548,9 @@ Navigation Links
it’s set to ``True``, end your links with a ``/``, otherwise end them
with ``/index.html`` — or else they won’t be highlighted when active.

There’s also ``NAVIGATION_ALT_LINKS``. Themes may display this somewhere
else, or not at all. Bootstrap puts it on the right side of the header.

The ``SEARCH_FORM`` option contains the HTML code for a search form based on
duckduckgo.com which should always work, but feel free to change it to
something else.
Expand Down
1 change: 1 addition & 0 deletions docs/template-variables.rst
Expand Up @@ -78,6 +78,7 @@ Name Type Descript
``meta_generator_tag`` bool ``META_GENERATOR_TAG`` setting
``momentjs_locales`` defaultdict<str, str> dictionary of available Moment.js locales
``navigation_links`` TranslatableSetting ``NAVIGATION_LINKS`` setting
``navigation_alt_links`` TranslatableSetting ``NAVIGATION_ALT_LINKS`` setting
``needs_ipython_css`` bool whether or not Jupyter CSS is needed by this site
``posts_sections`` bool ``POSTS_SECTIONS`` setting
``posts_section_are_indexes`` bool ``POSTS_SECTIONS_ARE_INDEXES`` setting
Expand Down

0 comments on commit 33361bc

Please sign in to comment.