summaryrefslogtreecommitdiffstats
path: root/nikola/data/themes/bootstrap/templates
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/data/themes/bootstrap/templates')
-rw-r--r--nikola/data/themes/bootstrap/templates/base.tmpl93
-rw-r--r--nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl96
-rw-r--r--nikola/data/themes/bootstrap/templates/gallery.tmpl86
-rw-r--r--nikola/data/themes/bootstrap/templates/slides.tmpl22
4 files changed, 297 insertions, 0 deletions
diff --git a/nikola/data/themes/bootstrap/templates/base.tmpl b/nikola/data/themes/bootstrap/templates/base.tmpl
new file mode 100644
index 0000000..8cb2e43
--- /dev/null
+++ b/nikola/data/themes/bootstrap/templates/base.tmpl
@@ -0,0 +1,93 @@
+## -*- 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}
+</head>
+<body>
+<!-- Menubar -->
+<div class="navbar navbar-fixed-top" id="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+
+ <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+
+ <a class="brand" href="${abs_link('/')}">
+ ${blog_title}
+ </a>
+ <!-- Everything you want hidden at 940px or less, place within here -->
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ ${bootstrap.html_navigation_links()}
+ </ul>
+ %if search_form:
+ ${search_form}
+ %endif
+ <ul class="nav pull-right">
+ <%block name="belowtitle">
+ %if len(translations) > 1:
+ <li>${base.html_translations()}</li>
+ %endif
+ </%block>
+ % if not hide_sourcelink:
+ <li><%block name="sourcelink"></%block></li>
+ %endif
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
+<!-- End of Menubar -->
+<div class="container-fluid" id="container-fluid">
+ <!--Body content-->
+ <div class="row-fluid">
+ <div class="span2"></div>
+ <div class="span8">
+ <%block name="content"></%block>
+ </div>
+ </div>
+ <!--End of body content-->
+</div>
+<div class="footerbox">
+ ${content_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>
+ <%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>
diff --git a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl
new file mode 100644
index 0000000..763ac20
--- /dev/null
+++ b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl
@@ -0,0 +1,96 @@
+## Override only the functions that differ from base_helper.tmpl
+<%def name="html_head()">
+ <meta charset="utf-8">
+ %if description:
+ <meta name="description" content="${description}">
+ %endif
+ <meta name="author" content="${blog_author}">
+ <title>${title|striphtml} | ${blog_title|striphtml}</title>
+ ${mathjax_config}
+ %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 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
+ %else:
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
+ %endif
+ %endif
+ %if favicons:
+ %for name, file, size in favicons:
+ <link rel="${name}" href="${file}" sizes="${size}"/>
+ %endfor
+ %endif
+</%def>
+
+<%def name="late_load_js()">
+ %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>
+ %else:
+ <script src="/assets/js/all-nocdn.js" type="text/javascript"></script>
+ %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>
+ %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>
+ %endif
+ <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script>
+ %endif
+</%def>
+
+
+<%def name="html_navigation_links()">
+ %for url, text in navigation_links[lang]:
+ % if isinstance(url, tuple):
+ <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="${suburl}">${text}</a>
+ %else:
+ <li><a href="${suburl}">${text}</a>
+ %endif
+ %endfor
+ </ul>
+ % else:
+ % if rel_link(permalink, url) == "#":
+ <li class="active"><a href="${url}">${text}</a>
+ %else:
+ <li><a href="${url}">${text}</a>
+ %endif
+ % endif
+ %endfor
+</%def>
diff --git a/nikola/data/themes/bootstrap/templates/gallery.tmpl b/nikola/data/themes/bootstrap/templates/gallery.tmpl
new file mode 100644
index 0000000..17ae61c
--- /dev/null
+++ b/nikola/data/themes/bootstrap/templates/gallery.tmpl
@@ -0,0 +1,86 @@
+## -*- coding: utf-8 -*-
+<%inherit file="base.tmpl"/>
+<%namespace name="comments" file="comments_helper.tmpl"/>
+<%namespace name="ui" file="crumbs.tmpl" import="bar"/>
+<%block name="sourcelink"></%block>
+
+<%block name="content">
+ ${ui.bar(crumbs)}
+ %if text:
+ <p>
+ ${text}
+ </p>
+ %endif
+ <ul>
+ % for folder in folders:
+ <li><a href="${folder}"><i class="icon-folder-open"></i>&nbsp;${folder}</a></li>
+ % endfor
+ </ul>
+
+ <div id="gallery_container"></div>
+ <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>
+%if enable_comments:
+ ${comments.comment_form(None, permalink, title)}
+%endif
+</%block>
+
+
+<%block name="extra_head">
+<style type="text/css">
+ .image-block {
+ display: inline-block;
+ }
+ .flowr_row {
+ width: 100%;
+ }
+ </style>
+</%block>
+
+
+<%block name="extra_js">
+<script src="/assets/js/flowr.plugin.js"></script>
+<script>
+jsonContent = ${photo_array_json};
+$("#gallery_container").flowr({
+ data : jsonContent,
+ height : ${thumbnail_size}*.6,
+ padding: 5,
+ rows: -1,
+ render : function(params) {
+ // Just return a div, string or a dom object, anything works fine
+ img = $("<img />").attr({
+ 'src': params.itemData.url_thumb,
+ 'width' : params.width,
+ 'height' : params.height
+ }).css('max-width', '100%');
+ link = $( "<a></a>").attr({
+ 'href': params.itemData.url,
+ 'class': 'image-reference'
+ });
+ div = $("<div />").addClass('image-block').attr({
+ 'title': params.itemData.title,
+ 'data-toggle': "tooltip",
+ });
+ link.append(img);
+ div.append(link);
+ div.hover(div.tooltip());
+ return div;
+ },
+ itemWidth : function(data) { return data.size.w; },
+ itemHeight : function(data) { return data.size.h; },
+ complete : function(params) {
+ if( jsonContent.length > params.renderedItems ) {
+ nextRenderList = jsonContent.slice( params.renderedItems );
+ }
+ }
+ });
+$("a.image-reference").colorbox({rel:"gal", maxWidth:"100%",maxHeight:"100%",scalePhotos:true});
+</script>
+</%block>
diff --git a/nikola/data/themes/bootstrap/templates/slides.tmpl b/nikola/data/themes/bootstrap/templates/slides.tmpl
new file mode 100644
index 0000000..14983ad
--- /dev/null
+++ b/nikola/data/themes/bootstrap/templates/slides.tmpl
@@ -0,0 +1,22 @@
+<div id="${carousel_id}" class="carousel slide">
+ <ol class="carousel-indicators">
+ % for i in range(len(content)):
+ % if i == 0:
+ <li data-target="#${carousel_id}" data-slide-to="${i}" class="active"></li>
+ % else:
+ <li data-target="#${carousel_id}" data-slide-to="${i}"></li>
+ % endif
+ % endfor
+ </ol>
+ <div class="carousel-inner">
+ % for i, image in enumerate(content):
+ % if i == 0:
+ <div class="item active"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div>
+ % else:
+ <div class="item"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div>
+ % endif
+ % endfor
+ </div>
+ <a class="left carousel-control" href="#${carousel_id}" data-slide="prev">&lsaquo;</a>
+ <a class="right carousel-control" href="#${carousel_id}" data-slide="next">&rsaquo;</a>
+</div>