diff options
Diffstat (limited to 'nikola/data/themes/bootstrap/templates')
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/base.tmpl | 56 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/base_helper.tmpl (renamed from nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl) | 156 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/gallery.tmpl | 35 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/listing.tmpl | 28 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/post.tmpl | 47 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/slides.tmpl | 6 | ||||
| -rw-r--r-- | nikola/data/themes/bootstrap/templates/tags.tmpl | 26 |
7 files changed, 255 insertions, 99 deletions
diff --git a/nikola/data/themes/bootstrap/templates/base.tmpl b/nikola/data/themes/bootstrap/templates/base.tmpl index 65132b7..a469098 100644 --- a/nikola/data/themes/bootstrap/templates/base.tmpl +++ b/nikola/data/themes/bootstrap/templates/base.tmpl @@ -1,28 +1,17 @@ ## -*- coding: utf-8 -*- <%namespace name="base" file="base_helper.tmpl" import="*" /> -<%namespace name="bootstrap" file="bootstrap_helper.tmpl" import="*" /> <%namespace name="notes" file="annotation_helper.tmpl" import="*" /> ${set_locale(lang)} -<!DOCTYPE html> -<html -%if comment_system == 'facebook': -xmlns:fb="http://ogp.me/ns/fb#" -%endif -lang="${lang}"> -<head> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - ${bootstrap.html_head()} - <%block name="extra_head"> - </%block> - % if annotations and post and not post.meta('noannotations'): - ${notes.css()} - % elif not annotations and post and post.meta('annotations'): - ${notes.css()} - % endif - ${extra_head_data} +${base.html_headstart()} +<%block name="extra_head"> +### Leave this block alone. +</%block> +${template_hooks['extra_head']()} </head> <body> + <!-- Menubar --> + <div class="navbar navbar-fixed-top" id="navbar"> <div class="navbar-inner"> <div class="container"> @@ -35,12 +24,19 @@ lang="${lang}"> </a> <a class="brand" href="${abs_link('/')}"> - ${blog_title} + %if logo_url: + <img src="${logo_url}" alt="${blog_title}" id="logo"> + %endif + + % if show_blog_title: + <span id="blog-title">${blog_title}</span> + % endif </a> <!-- Everything you want hidden at 940px or less, place within here --> <div class="nav-collapse collapse"> <ul class="nav"> - ${bootstrap.html_navigation_links()} + ${base.html_navigation_links()} + ${template_hooks['menu']()} </ul> %if search_form: ${search_form} @@ -51,9 +47,10 @@ lang="${lang}"> <li>${base.html_translations()}</li> %endif </%block> - % if not hide_sourcelink: + % if show_sourcelink: <li><%block name="sourcelink"></%block></li> %endif + ${template_hooks['menu_alt']()} </ul> </div> </div> @@ -65,6 +62,7 @@ lang="${lang}"> <div class="row-fluid"> <div class="span2"></div> <div class="span8"> + ${template_hooks['page_header']()} <%block name="content"></%block> </div> </div> @@ -72,23 +70,17 @@ lang="${lang}"> </div> <div class="footerbox"> ${content_footer} + ${template_hooks['page_footer']()} </div> -${bootstrap.late_load_js()} -${base.html_social()} - <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true}); - $(window).on('hashchange', function(){ - if (location.hash && $(location.hash)[0]) { - $('body').animate({scrollTop: $(location.hash).offset().top - $('#navbar').outerHeight(true)*1.2 }, 1); - } - }); - $(document).ready(function(){$(window).trigger('hashchange')}); - </script> +${base.late_load_js()} + <script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> <%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} +${body_end} +${template_hooks['body_end']()} </body> </html> diff --git a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl b/nikola/data/themes/bootstrap/templates/base_helper.tmpl index c041e50..2dcc138 100644 --- a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl +++ b/nikola/data/themes/bootstrap/templates/base_helper.tmpl @@ -1,77 +1,117 @@ -## Override only the functions that differ from base_helper.tmpl -<%def name="html_head()"> +## -*- coding: utf-8 -*- + +<%def name="html_headstart()"> +<!DOCTYPE html> +<html +\ +% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'): +prefix='\ +%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']): +og: http://ogp.me/ns# \ +%endif +%if use_open_graph: +article: http://ogp.me/ns/article# \ +%endif +%if comment_system == 'facebook': +fb: http://ogp.me/ns/fb# \ +%endif +'\ +%endif +\ +% if is_rtl: +dir="rtl" \ +% endif +\ +lang="${lang}"> + <head> <meta charset="utf-8"> %if description: <meta name="description" content="${description}"> %endif - <meta name="author" content="${blog_author}"> + <meta name="viewport" content="width=device-width"> <title>${title|striphtml} | ${blog_title|striphtml}</title> + + ${html_stylesheets()} + ${html_feedlinks()} + %if permalink: + <link rel="canonical" href="${abs_link(permalink)}"> + %endif + + %if favicons: + %for name, file, size in favicons: + <link rel="${name}" href="${file}" sizes="${size}"/> + %endfor + %endif + + % if comment_system == 'facebook': + <meta property="fb:app_id" content="${comment_system_id}"> + % endif + ${mathjax_config} + %if use_cdn: + <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> + %else: + <!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]--> + %endif + + ${extra_head_data} +</%def> + + +<%def name="late_load_js()"> %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"> + <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="/assets/js/all.js"></script> %else: - <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/all-nocdn.js"></script> %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 permalink: - <link rel="canonical" href="${abs_link(permalink)}"> - %endif - <!--[if lt IE 9]> - <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> - <![endif]--> - %if rss_link: - ${rss_link} - %else: - %if len(translations) > 1: - %for language in translations: - <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> - %endfor + <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> %else: - <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}"> + <script src="/assets/js/jquery.min.js"></script> + <script src="/assets/js/bootstrap.min.js"></script> %endif + <script src="/assets/js/jquery.colorbox-min.js"></script> %endif - %if favicons: - %for name, file, size in favicons: - <link rel="${name}" href="${file}" sizes="${size}"/> - %endfor + %if colorbox_locales[lang]: + <script src="/assets/js/colorbox-i18n/jquery.colorbox-${colorbox_locales[lang]}.js"></script> %endif + ${social_buttons_code} </%def> -<%def name="late_load_js()"> + +<%def name="html_stylesheets()"> %if use_bundles: %if use_cdn: - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> - <script src="/assets/js/all.js" type="text/javascript"></script> + <link href="//netdna.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: - <script src="/assets/js/all-nocdn.js" type="text/javascript"></script> + <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> %endif %else: %if use_cdn: - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> %else: - <script src="/assets/js/jquery-1.10.2.min.js" type="text/javascript"></script> - <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> + <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 - <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> %endif + % if annotations and post and not post.meta('noannotations'): + ${notes.css()} + % elif not annotations and post and post.meta('annotations'): + ${notes.css()} + % endif </%def> @@ -97,3 +137,25 @@ % endif %endfor </%def> + +<%def name="html_feedlinks()"> + %if rss_link: + ${rss_link} + %elif generate_rss: + %if len(translations) > 1: + %for language in translations: + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> + %endfor + %else: + <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}"> + %endif + %endif +</%def> + +<%def name="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> + %endif + %endfor +</%def> diff --git a/nikola/data/themes/bootstrap/templates/gallery.tmpl b/nikola/data/themes/bootstrap/templates/gallery.tmpl index 7b0d505..8ad4eb4 100644 --- a/nikola/data/themes/bootstrap/templates/gallery.tmpl +++ b/nikola/data/themes/bootstrap/templates/gallery.tmpl @@ -9,38 +9,37 @@ %if title: <h1>${title}</h1> %endif - %if text: + %if post: <p> - ${text} + ${post.text()} </p> %endif %if folders: <ul> % for folder, ftitle in folders: - <li><a href="${folder}"><i - class="icon-folder-open"></i> ${ftitle}</a></li> + <li><a href="${folder}"><i class="icon-folder-open"></i> ${ftitle}</a></li> % endfor </ul> %endif - <div id="gallery_container"></div> - %if photo_array: - <noscript> - <ul class="thumbnails"> - %for image in photo_array: - <li><a href="${image['url']}" class="thumbnail image-reference" title="${image['title']}"> - <img src="${image['url_thumb']}" alt="${image['title']}" /></a> - %endfor - </ul> - </noscript> - %endif -%if enable_comments: - ${comments.comment_form(None, permalink, title)} +<div id="gallery_container"></div> +%if photo_array: +<noscript> +<ul class="thumbnails"> + %for image in photo_array: + <li><a href="${image['url']}" class="thumbnail image-reference" title="${image['title']}"> + <img src="${image['url_thumb']}" alt="${image['title']}" /></a> + %endfor +</ul> +</noscript> +%endif +%if site_has_comments and enable_comments: +${comments.comment_form(None, permalink, title)} %endif </%block> - <%block name="extra_head"> +${parent.extra_head()} <style type="text/css"> .image-block { display: inline-block; diff --git a/nikola/data/themes/bootstrap/templates/listing.tmpl b/nikola/data/themes/bootstrap/templates/listing.tmpl new file mode 100644 index 0000000..f03ea23 --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/listing.tmpl @@ -0,0 +1,28 @@ +## -*- coding: utf-8 -*- +<%inherit file="base.tmpl"/> +<%namespace name="ui" file="crumbs.tmpl" import="bar"/> + +<%block name="content"> +${ui.bar(crumbs)} +%if folders or files: +<ul class="list-unstyled"> +% for name in folders: + <li><a href="${name}"><i class="icon-folder-open"></i> ${name}</a> +% endfor +% for name in files: + <li><a href="${name}.html"><i class="icon-file"></i> ${name}</a> +% endfor +</ul> +%endif +% if code: + ${code} +% endif +</%block> + +<%block name="sourcelink"> +% if source_link: + <li> + <a href="${source_link}" id="sourcelink">${messages("Source")}</a> + </li> +% endif +</%block> diff --git a/nikola/data/themes/bootstrap/templates/post.tmpl b/nikola/data/themes/bootstrap/templates/post.tmpl new file mode 100644 index 0000000..29a5b75 --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/post.tmpl @@ -0,0 +1,47 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="pheader" file="post_header.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> +<%inherit file="base.tmpl"/> + +<%block name="extra_head"> + ${parent.extra_head()} + % if post.meta('keywords'): + <meta name="keywords" content="${post.meta('keywords')|h}"> + % endif + <meta name="author" content="${post.author()}"> + ${helper.open_graph_metadata(post)} + ${helper.twitter_card_information(post)} + ${helper.meta_translations(post)} +</%block> + +<%block name="content"> +<article class="post-${post.meta('type')} h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article"> + ${pheader.html_post_header()} + <div class="e-content entry-content" itemprop="articleBody text"> + ${post.text()} + </div> + <aside class="postpromonav"> + <nav> + ${helper.html_tags(post)} + ${helper.html_pager(post)} + </nav> + </aside> + % if not post.meta('nocomments') and site_has_comments: + <section class="comments"> + <h2>${messages("Comments")}</h2> + ${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)} + </section> + % endif + ${helper.mathjax_script(post)} +</article> +${comments.comment_link_script()} +</%block> + +<%block name="sourcelink"> +% if show_sourcelink: + <li> + <a href="${post.source_link()}" id="sourcelink">${messages("Source")}</a> + </li> +% endif +</%block> diff --git a/nikola/data/themes/bootstrap/templates/slides.tmpl b/nikola/data/themes/bootstrap/templates/slides.tmpl index 14983ad..048fb7e 100644 --- a/nikola/data/themes/bootstrap/templates/slides.tmpl +++ b/nikola/data/themes/bootstrap/templates/slides.tmpl @@ -1,6 +1,7 @@ +<%block name="content"> <div id="${carousel_id}" class="carousel slide"> <ol class="carousel-indicators"> - % for i in range(len(content)): + % for i in range(len(slides_content)): % if i == 0: <li data-target="#${carousel_id}" data-slide-to="${i}" class="active"></li> % else: @@ -9,7 +10,7 @@ % endfor </ol> <div class="carousel-inner"> - % for i, image in enumerate(content): + % for i, image in enumerate(slides_content): % if i == 0: <div class="item active"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div> % else: @@ -20,3 +21,4 @@ <a class="left carousel-control" href="#${carousel_id}" data-slide="prev">‹</a> <a class="right carousel-control" href="#${carousel_id}" data-slide="next">›</a> </div> +</%block> diff --git a/nikola/data/themes/bootstrap/templates/tags.tmpl b/nikola/data/themes/bootstrap/templates/tags.tmpl new file mode 100644 index 0000000..9afeca7 --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/tags.tmpl @@ -0,0 +1,26 @@ +## -*- coding: utf-8 -*- +<%inherit file="base.tmpl"/> + +<%block name="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> + % endif + % endfor + </ul> + % if items: + <h2>${messages("Tags")}</h2> + % endif +%endif +% if items: + <ul class="list-inline"> + % for text, link in items: + <li><a class="reference badge" href="${link}">${text}</a></li> + % endfor + </ul> +% endif +</%block> |
