diff options
Diffstat (limited to 'nikola/data/themes/bootstrap-jinja/templates')
7 files changed, 62 insertions, 142 deletions
diff --git a/nikola/data/themes/bootstrap-jinja/templates/base.tmpl b/nikola/data/themes/bootstrap-jinja/templates/base.tmpl index e9bed3c..3177276 100644 --- a/nikola/data/themes/bootstrap-jinja/templates/base.tmpl +++ b/nikola/data/themes/bootstrap-jinja/templates/base.tmpl @@ -13,7 +13,7 @@ <!-- Menubar --> -<div class="navbar navbar-fixed-top" id="navbar"> +<div class="navbar navbar-static-top" id="navbar"> <div class="navbar-inner"> <div class="container"> @@ -24,7 +24,7 @@ <span class="icon-bar"></span> </a> - <a class="brand" href="{{ abs_link('/') }}"> + <a class="brand" href="{{ abs_link(_link("root", None, lang)) }}"> {% if logo_url %} <img src="{{ logo_url }}" alt="{{ blog_title }}" id="logo"> {% endif %} @@ -58,7 +58,7 @@ </div> </div> <!-- End of Menubar --> -<div class="container-fluid" id="content"> +<div class="container-fluid" id="content" role="main"> <!--Body content--> <div class="row-fluid"> <div class="span2"></div> @@ -74,7 +74,13 @@ {{ template_hooks['page_footer']() }} </div> {{ base.late_load_js() }} - <script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> + <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 extra_js %}{% endblock %} {% if annotations and post and not post.meta('noannotations') %} {{ notes.code() }} diff --git a/nikola/data/themes/bootstrap-jinja/templates/base_helper.tmpl b/nikola/data/themes/bootstrap-jinja/templates/base_helper.tmpl index e44b3a7..4a29e69 100644 --- a/nikola/data/themes/bootstrap-jinja/templates/base_helper.tmpl +++ b/nikola/data/themes/bootstrap-jinja/templates/base_helper.tmpl @@ -1,5 +1,6 @@ {# -*- coding: utf-8 -*- #} +{% import 'annotation_helper.tmpl' as notes with context %} {% macro html_headstart() %} <!DOCTYPE html> <html @@ -68,19 +69,21 @@ lang="{{ lang }}"> {% macro late_load_js() %} {% if use_bundles %} {% if use_cdn %} - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> + <script src="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="/assets/js/all.js"></script> {% else %} <script src="/assets/js/all-nocdn.js"></script> {% endif %} {% else %} {% if use_cdn %} - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> + <script src="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> {% else %} <script src="/assets/js/jquery.min.js"></script> <script src="/assets/js/bootstrap.min.js"></script> + <script src="/assets/js/moment-with-locales.min.js"></script> + <script src="/assets/js/fancydates.js"></script> {% endif %} <script src="/assets/js/jquery.colorbox-min.js"></script> {% endif %} @@ -94,14 +97,14 @@ lang="{{ lang }}"> {% macro html_stylesheets() %} {% if use_bundles %} {% if use_cdn %} - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> + <link href="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> {% else %} <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> {% endif %} {% else %} {% if use_cdn %} - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> + <link href="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> {% else %} <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"> @@ -114,6 +117,10 @@ lang="{{ lang }}"> <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> {% endif %} {% endif %} + {% if needs_ipython_css %} + <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css"> + {% endif %} {% if annotations and post and not post.meta('noannotations') %} {{ notes.css() }} {% elif not annotations and post and post.meta('annotations') %} @@ -129,7 +136,7 @@ lang="{{ lang }}"> <ul class="dropdown-menu"> {% for suburl, text in url %} {% if rel_link(permalink, suburl) == "#" %} - <li class="active"><a href="{{ permalink }}">{{ text }}</a> + <li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a> {% else %} <li><a href="{{ suburl }}">{{ text }}</a> {% endif %} @@ -137,7 +144,7 @@ lang="{{ lang }}"> </ul> {% else %} {% if rel_link(permalink, url) == "#" %} - <li class="active"><a href="{{ permalink }}">{{ text }}</a> + <li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a> {% else %} <li><a href="{{ url }}">{{ text }}</a> {% endif %} @@ -157,12 +164,21 @@ lang="{{ lang }}"> <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}"> {% endif %} {% endif %} + {% if generate_atom %} + {% if translations|length > 1 %} + {% for language in translations %} + <link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}"> + {% endfor %} + {% else %} + <link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}"> + {% endif %} + {% endif %} {% endmacro %} {% macro html_translations() %} {% for langname in translations.keys() %} {% if langname != lang %} - <li><a href="{{ _link("index", None, langname) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></li> + <li><a href="{{ abs_link(_link("root", None, langname)) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></li> {% endif %} {% endfor %} {% endmacro %} diff --git a/nikola/data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl b/nikola/data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl deleted file mode 100644 index e426774..0000000 --- a/nikola/data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl +++ /dev/null @@ -1,78 +0,0 @@ -{# -*- coding: utf-8 -*- #} -{# Override only the functions that differ from base_helper.tmpl #} - -{% block html_stylesheets %} - {% if use_bundles %} - {% if use_cdn %} - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> - <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> - {% else %} - <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> - {% endif %} - {% else %} - {% if use_cdn %} - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> - {% else %} - <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> - <link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"> - {% endif %} - <link href="/assets/css/rst.css" rel="stylesheet" type="text/css"> - <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> - <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css"/> - <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> - {% if has_custom_css %} - <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> - {% endif %} - {% endif %} - {% if annotations and post and not post.meta('noannotations') %} - {{ notes.css() }} - {% elif not annotations and post and post.meta('annotations') %} - {{ notes.css() }} - {% endif %} -{% endblock %} - - -{% block late_load_js %} - {% if use_bundles %} - {% if use_cdn %} - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> - <script src="/assets/js/all.js"></script> - {% else %} - <script src="/assets/js/all-nocdn.js"></script> - {% endif %} - {% else %} - {% if use_cdn %} - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> - {% else %} - <script src="/assets/js/jquery-1.11.0.min.js"></script> - <script src="/assets/js/bootstrap.min.js"></script> - {% endif %} - <script src="/assets/js/jquery.colorbox-min.js"></script> - {% endif %} -{% endblock %} - - -{% block html_navigation_links %} - {% for url, text in navigation_links[lang] %} - {% if url is mapping %} - <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ text }}<b class="caret"></b></a> - <ul class="dropdown-menu"> - {% for suburl, text in url %} - {% if rel_link(permalink, suburl) == "#" %} - <li class="active"><a href="{{ permalink }}">{{ text }}</a> - {% else %} - <li><a href="{{ suburl }}">{{ text }}</a> - {% endif %} - {% endfor %} - </ul> - {% else %} - {% if rel_link(permalink, url) == "#" %} - <li class="active"><a href="{{ permalink }}">{{ text }}</a> - {% else %} - <li><a href="{{ url }}">{{ text }}</a> - {% endif %} - {% endif %} - {% endfor %} -{% endblock %} diff --git a/nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl b/nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl index e3f9f05..07112da 100644 --- a/nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl +++ b/nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl @@ -7,7 +7,7 @@ {% block content %} {{ ui.bar(crumbs) }} {% if title %} - <h1>{{ title }}</h1> + <h1>{{ title|e }}</h1> {% endif %} {% if post %} <p> @@ -40,6 +40,7 @@ {% block extra_head %} {{ super() }} +<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml"> <style type="text/css"> .image-block { display: inline-block; diff --git a/nikola/data/themes/bootstrap-jinja/templates/post.tmpl b/nikola/data/themes/bootstrap-jinja/templates/post.tmpl index 54646d0..df4109c 100644 --- a/nikola/data/themes/bootstrap-jinja/templates/post.tmpl +++ b/nikola/data/themes/bootstrap-jinja/templates/post.tmpl @@ -14,10 +14,13 @@ {% endif %} <meta name="author" content="{{ post.author() }}"> {% if post.prev_post %} - <link rel="prev" href="{{ post.prev_post.permalink() }}" title="{{ post.prev_post.title() }}" type="text/html"> + <link rel="prev" href="{{ post.prev_post.permalink() }}" title="{{ post.prev_post.title()|e }}" type="text/html"> {% endif %} {% if post.next_post %} - <link rel="next" href="{{ post.next_post.permalink() }}" title="{{ post.next_post.title() }}" type="text/html"> + <link rel="next" href="{{ post.next_post.permalink() }}" title="{{ post.next_post.title()|e }}" type="text/html"> + {% endif %} + {% if post.is_draft %} + <meta name="robots" content="noindex"> {% endif %} {{ helper.open_graph_metadata(post) }} {{ helper.twitter_card_information(post) }} @@ -37,7 +40,7 @@ </nav> </aside> {% if not post.meta('nocomments') and site_has_comments %} - <section class="comments"> + <section class="comments hidden-print"> <h2>{{ messages("Comments") }}</h2> {{ comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path) }} </section> diff --git a/nikola/data/themes/bootstrap-jinja/templates/post_header.tmpl b/nikola/data/themes/bootstrap-jinja/templates/post_header.tmpl deleted file mode 100644 index b565244..0000000 --- a/nikola/data/themes/bootstrap-jinja/templates/post_header.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -{# -*- coding: utf-8 -*- #} -{% import 'post_helper.tmpl' as helper with context %} -{% import 'comments_helper.tmpl' as comments with context %} - -{% macro html_title() %} - <h1 class="p-name entry-title" itemprop="headline name"><a href="{{ post.permalink() }}" class="u-url">{{ title|e }}</a></h1> -{% endmacro %} - -{% macro html_translations(post) %} - {% if translations|length > 1 %} - <div class="metadata posttranslations translations"> - <h3 class="posttranslations-intro">{{ messages("Also available in:") }}</h3> - {% for langname in translations.keys() %} - {% if langname != lang and post.is_translation_available(langname) %} - <p><a href="{{ post.permalink(langname) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></p> - {% endif %} - {% endfor %} - </div> - {% endif %} -{% endmacro %} - -{% macro html_post_header() %} - <header> - {{ html_title() }} - <div class="metadata"> - <p class="byline author vcard"><span class="byline-name fn">{{ post.author() }}</span></p> - <p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.date.isoformat() }}" itemprop="datePublished" title="{{ messages("Publication date") }}">{{ post.formatted_date(date_format) }}</time></a></p> - {% if not post.meta('nocomments') and site_has_comments %} - <p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }} - {% endif %} - {% if post.meta('link') %} - <p><a href='{{ post.meta('link') }}'>{{ messages("Original site") }}</a></p> - {% endif %} - {% if post.description() %} - <meta content="{{ post.description() }}" itemprop="description"> - {% endif %} - </div> - {{ html_translations(post) }} - </header> -{% endmacro %} diff --git a/nikola/data/themes/bootstrap-jinja/templates/tags.tmpl b/nikola/data/themes/bootstrap-jinja/templates/tags.tmpl index 080e621..c308f19 100644 --- a/nikola/data/themes/bootstrap-jinja/templates/tags.tmpl +++ b/nikola/data/themes/bootstrap-jinja/templates/tags.tmpl @@ -4,14 +4,24 @@ {% block content %} <h1>{{ title }}</h1> {% if cat_items %} - <h2>{{ messages("Categories") }}</h2> - <ul class="unstyled"> - {% for text, link in cat_items %} - {% if text %} - <li><a class="reference badge" href="{{ link }}">{{ text }}</a></li> + {% if items %} + <h2>{{ messages("Categories") }}</h2> + {% endif %} + {% for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy %} + {% for i in range(indent_change_before) %} + <ul class="unstyled"> + {% endfor %} + <li><a class="reference badge" href="{{ link }}">{{ text }}</a> + {% if indent_change_after <= 0 %} + </li> {% endif %} + {% for i in range(-indent_change_after) %} + </ul> + {% if i + 1 < indent_levels|length %} + </li> + {% endif %} + {% endfor %} {% endfor %} - </ul> {% if items %} <h2>{{ messages("Tags") }}</h2> {% endif %} @@ -19,7 +29,9 @@ {% if items %} <ul class="list-inline"> {% for text, link in items %} - <li><a class="reference badge" href="{{ link }}">{{ text }}</a></li> + {% if text not in hidden_tags %} + <li><a class="reference badge" href="{{ link }}">{{ text }}</a></li> + {% endif %} {% endfor %} </ul> {% endif %} |
