Skip to content
Permalink
Browse files

Update navigation

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 8, 2017
1 parent 79e4d05 commit c5d1ee7142b6bec7a4274e3ea464e75f360fe452
Showing with 158 additions and 6 deletions.
  1. +55 −6 conf.py
  2. +103 −0 templates/base.tmpl
61 conf.py
@@ -40,8 +40,14 @@
'versions_supported': [7],
}

plugins_submenu = (
('/', 'Plugins Home'),
('/categories/', 'Categories'),
('/v7/', 'Version 7'),
)

# Output folder -- change if using locally
OUTPUT_FOLDER = '/srv/www/plugins.getnikola.com:80'
# OUTPUT_FOLDER = '/srv/www/plugins.getnikola.com:80'

# Nikola is multilingual!
#
@@ -149,9 +155,52 @@

NAVIGATION_LINKS = {
DEFAULT_LANG: (
("/v7/", "Version 7"),
("/categories/", "Categories"),
("https://getnikola.com/", "Nikola Home Page"),
(
(
('/documentation.html', '<strong>Documentation Index</strong>'),
('/getting-started.html', '<strong>Getting Started</strong>'),
('/handbook.html', '<strong>Handbook</strong>'),
('/features/index.html', '<strong>Features</strong>'),
('/conf.html', 'conf.py'),
('/changes.html', 'Changelog'),
('/creating-a-theme.html', 'Theming Tutorial'),
('/extending.html', 'Extending'),
('/internals.html', 'Internals'),
('/creating-a-site-not-a-blog-with-nikola.html', 'Creating a Site (Not a Blog)'),
('/license.html', 'License'),
),
'Documentation'
),
(
(
('https://github.com/getnikola/nikola/issues', 'Issue Tracker'),
('https://groups.google.com/group/nikola-discuss', 'Mailing List'),
('https://twitter.com/GetNikola', 'Twitter'),
('https://irclogs.getnikola.com/', 'IRC logs (#nikola@freenode)'),
('/contact.html', '<strong>All support options</strong>'),
),
'Support & Contact'
),
(
(
('https://themes.getnikola.com', 'Themes'),
('https://plugins.getnikola.com', 'Plugins'),
('https://github.com/getnikola/shortcodes', 'Shortcodes'),
),
'Add-ons'
),
(
(
('https://github.com/getnikola/nikola', '<strong>Source code (GitHub)</strong>'),
('https://github.com/getnikola/nikola/issues', 'Issue Tracker'),
('/changes.html', 'Changelog'),
('/license.html', 'License'),
('/authors.html', 'Contributors'),
),
'Development'
),
('/blog/index.html', 'Blog'),
('https://users.getnikola.com', 'Users'),
),
}

@@ -307,7 +356,7 @@

# If you want to hide the title of your website (for example, if your logo
# already contains the text), set this to False.
# SHOW_BLOG_TITLE = True
SHOW_BLOG_TITLE = False

# Writes tag cloud data in form of tag_cloud_data.json.
# Warning: this option will change its default value to False in v8!
@@ -1247,7 +1296,7 @@

# Put in global_context things you want available on all your templates.
# It can be anything, data, functions, modules, etc.
GLOBAL_CONTEXT = {}
GLOBAL_CONTEXT = {'plugins_submenu': plugins_submenu}

# Add functions here and they will be called with template
# GLOBAL_CONTEXT as parameter when the template is about to be
@@ -0,0 +1,103 @@
## -*- coding: utf-8 -*-
<%namespace name="base" file="base_helper.tmpl" import="*" />
<%namespace name="notes" file="annotation_helper.tmpl" import="*" />
${set_locale(lang)}
${base.html_headstart()}
<%block name="extra_head">
### Leave this block alone.
</%block>
${template_hooks['extra_head']()}
</head>
<body>
<a href="#content" class="sr-only sr-only-focusable">${messages("Skip to main content")}</a>

<!-- Menubar -->

<nav class="navbar navbar-inverse navbar-static-top">
<div class="container"><!-- This keeps the margins nice -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar" aria-controls="bs-navbar" aria-expanded="false">
<span class="sr-only">${messages("Toggle navigation")}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://getnikola.com/">
%if logo_url:
<img src="${logo_url}" alt="${blog_title|h}" id="logo">
%endif

% if show_blog_title:
<span id="blog-title">${blog_title|h}</span>
% endif
</a>
</div><!-- /.navbar-header -->
<div class="collapse navbar-collapse" id="bs-navbar" aria-expanded="false">
<ul class="nav navbar-nav">
${base.html_navigation_links()}
${template_hooks['menu']()}
</ul>
%if search_form:
${search_form}
%endif

<ul class="nav navbar-nav navbar-right">
<%block name="belowtitle">
%if len(translations) > 1:
<li>${base.html_translations()}</li>
%endif
</%block>
% if show_sourcelink:
<%block name="sourcelink"></%block>
%endif
${template_hooks['menu_alt']()}
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>

<!-- End of Menubar -->

<div class="container" id="content" role="main">
<div class="body-content">
<!--Body content-->
<div class="row">
${template_hooks['page_header']()}
<ul class="nav nav-pills">
% for url, text in plugins_submenu:
% if rel_link(permalink, url) == "#":
<li class="active"><a href="${permalink}">${text} <span class="sr-only">${messages("(active)", lang)}</span></a></li>
% else:
<li><a href="${url}">${text}</a></li>
% endif
% endfor
</ul>
<%block name="content"></%block>
</div>
<!--End of body content-->

<footer id="footer">
${content_footer}
${template_hooks['page_footer']()}
</footer>
</div>
</div>

${base.late_load_js()}
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
<!-- fancy dates -->
<script>
moment.locale("${momentjs_locales[lang]}");
fancydates(${date_fanciness}, ${js_date_format});
</script>
<!-- end fancy dates -->
<%block name="extra_js"></%block>
% if annotations and post and not post.meta('noannotations'):
${notes.code()}
% elif not annotations and post and post.meta('annotations'):
${notes.code()}
% endif
${body_end}
${template_hooks['body_end']()}
</body>
</html>

0 comments on commit c5d1ee7

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