diff --git a/v7/bootblog-jinja/README.md b/v7/bootblog-jinja/README.md new file mode 100644 index 0000000..a946d36 --- /dev/null +++ b/v7/bootblog-jinja/README.md @@ -0,0 +1,9 @@ +Bootblog +======== + +This is the Bootstrap 3 [Blog theme](http://getbootstrap.com/examples/blog/), +adapted for Nikola. + +Some things require additional configuration (eg. the sidebar and the navbar). +Note that some things had to be substantially changed for this theme — for +example, menus are not ` + + + + + +
+
+
+

+ + {% if logo_url %} + + {% endif %} + + {% if show_blog_title %} + {{ blog_title }} + {% endif %} + +

+

{{ blog_description }}

+ {{ template_hooks['page_header']() }} +
+ +
+
+ {% block content %}{% endblock %} +
+
+ {{ blog_sidebar }} +
+ +
+
+
+ + + +{{ base.late_load_js() }} + + + + + {% block extra_js %}{% endblock %} + {% 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']() }} + + diff --git a/v7/bootblog-jinja/templates/base_helper.tmpl b/v7/bootblog-jinja/templates/base_helper.tmpl new file mode 100644 index 0000000..0f7026d --- /dev/null +++ b/v7/bootblog-jinja/templates/base_helper.tmpl @@ -0,0 +1,169 @@ +{# -*- coding: utf-8 -*- #} + +{% import 'annotation_helper.tmpl' as notes with context %} +{% macro html_headstart() %} + + + + + {% if description %} + + {% endif %} + + {{ title|e }} | {{ blog_title|e }} + + {{ html_stylesheets() }} + {{ html_feedlinks() }} + {% if permalink %} + + {% endif %} + + {% if favicons %} + {% for name, file, size in favicons %} + + {% endfor %} + {% endif %} + + {% if comment_system == 'facebook' %} + + {% endif %} + + {% if prevlink %} + + {% endif %} + {% if nextlink %} + + {% endif %} + + {{ mathjax_config }} + {% if use_cdn %} + + {% else %} + + {% endif %} + + {{ extra_head_data }} +{% endmacro %} + +{% macro late_load_js() %} + {% if use_bundles %} + {% if use_cdn %} + + + + {% else %} + + {% endif %} + {% else %} + {% if use_cdn %} + + + {% else %} + + + + + {% endif %} + + {% endif %} + {% if colorbox_locales[lang] %} + + {% endif %} + {{ social_buttons_code }} +{% endmacro %} + + +{% macro html_stylesheets() %} + {% if use_bundles %} + {% if use_cdn %} + + + {% else %} + + {% endif %} + {% else %} + {% if use_cdn %} + + {% else %} + + {% endif %} + + + + + + {% if has_custom_css %} + + {% endif %} + {% endif %} + {% if needs_ipython_css %} + + + {% endif %} + {% if annotations and post and not post.meta('noannotations') %} + {{ notes.css() }} + {% elif not annotations and post and post.meta('annotations') %} + {{ notes.css() }} + {% endif %} +{% endmacro %} + +{% macro html_navigation_links() %} + {% for url, text in navigation_links[lang] %} + {% if rel_link(permalink, url) == "#" %} + {{ text }} {{ messages("(active)", lang) }} + {% else %} + {{ text }} + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro html_feedlinks() %} + {% if rss_link %} + {{ rss_link }} + {% elif generate_rss %} + {% if translations|length > 1 %} + {% for language in translations %} + + {% endfor %} + {% else %} + + {% endif %} + {% endif %} + {% if generate_atom %} + {% if translations|length > 1 %} + {% for language in translations %} + + {% endfor %} + {% else %} + + {% endif %} + {% endif %} +{% endmacro %} + +{% macro html_translations() %} + {% for langname in translations.keys() %} + {% if langname != lang %} + {{ messages("LANGUAGE", langname) }} + {% endif %} + {% endfor %} +{% endmacro %} diff --git a/v7/bootblog-jinja/templates/index.tmpl b/v7/bootblog-jinja/templates/index.tmpl new file mode 100644 index 0000000..47dba12 --- /dev/null +++ b/v7/bootblog-jinja/templates/index.tmpl @@ -0,0 +1,42 @@ +{# -*- coding: utf-8 -*- #} +{% import 'index_helper.tmpl' as helper with context %} +{% import 'comments_helper.tmpl' as comments with context %} +{% extends 'base.tmpl' %} + +{% block extra_head %} + {{ super() }} + {% if posts and (permalink == '/' or permalink == '/' + index_file) %} + + {% endif %} +{% endblock %} + +{% block content %} +{% block content_header %}{% endblock %} +
+{% for post in posts %} +
+
+

{{ post.title()|e }}

+ +
+ {% if index_teasers %} +
+ {{ post.text(teaser_only=True) }} + {% else %} +
+ {{ post.text(teaser_only=False) }} + {% endif %} +
+
+{% endfor %} +
+{{ helper.html_pager() }} +{{ comments.comment_link_script() }} +{{ helper.mathjax_script(posts) }} +{% endblock %} diff --git a/v7/bootblog-jinja/templates/post.tmpl b/v7/bootblog-jinja/templates/post.tmpl new file mode 100644 index 0000000..c1951aa --- /dev/null +++ b/v7/bootblog-jinja/templates/post.tmpl @@ -0,0 +1,57 @@ +{# -*- coding: utf-8 -*- #} +{% import 'post_helper.tmpl' as helper with context %} +{% import 'post_header.tmpl' as pheader with context %} +{% import 'comments_helper.tmpl' as comments with context %} +{% extends 'base.tmpl' %} + +{% block extra_head %} + {{ super() }} + {% if post.meta('keywords') %} + + {% endif %} + {% if post.description() %} + + {% endif %} + + {% if post.prev_post %} + + {% endif %} + {% if post.next_post %} + + {% endif %} + {% if post.is_draft %} + + {% endif %} + {{ helper.open_graph_metadata(post) }} + {{ helper.twitter_card_information(post) }} + {{ helper.meta_translations(post) }} +{% endblock %} + +{% block content %} +
+ {{ pheader.html_post_header() }} +
+ {{ post.text() }} +
+ + {% if not post.meta('nocomments') and site_has_comments %} +
+

{{ messages("Comments") }}

+ {{ comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path) }} +
+ {% endif %} + {{ helper.mathjax_script(post) }} +
+{{ comments.comment_link_script() }} +{% endblock %} + +{% block sourcelink %} +{% if show_sourcelink %} + {{ messages("Source") }} +{% endif %} +{% endblock %} diff --git a/v7/bootblog-jinja/templates/post_header.tmpl b/v7/bootblog-jinja/templates/post_header.tmpl new file mode 100644 index 0000000..d1f14fb --- /dev/null +++ b/v7/bootblog-jinja/templates/post_header.tmpl @@ -0,0 +1,49 @@ +{# -*- coding: utf-8 -*- #} +{% import 'post_helper.tmpl' as helper with context %} +{% import 'comments_helper.tmpl' as comments with context %} + +{% macro html_title() %} +{% if title and not post.meta('hidetitle') %} +

{{ post.title()|e }}

+{% endif %} +{% endmacro %} + +{% macro html_translations(post) %} + {% if post.translated_to|length > 1 %} +
+

{{ messages("Also available in:") }}

+ {% for langname in translations.keys() %} + {% if langname != lang and post.is_translation_available(langname) %} +

{{ messages("LANGUAGE", langname) }}

+ {% endif %} + {% endfor %} +
+ {% endif %} +{% endmacro %} + +{% macro html_sourcelink() %} + {% if show_sourcelink %} +

{{ messages("Source") }}

+ {% endif %} +{% endmacro %} + +{% macro html_post_header() %} +
+ {{ html_title() }} +
+ + + {% if not post.meta('nocomments') and site_has_comments %} +

{{ comments.comment_link(post.permalink(), post._base_path) }} + {% endif %} + {{ html_sourcelink() }} + {% if post.meta('link') %} +

{{ messages("Original site") }}

+ {% endif %} + {% if post.description() %} + + {% endif %} +
+ {{ html_translations(post) }} +
+{% endmacro %} diff --git a/v7/bootblog/README.md b/v7/bootblog/README.md new file mode 100644 index 0000000..a946d36 --- /dev/null +++ b/v7/bootblog/README.md @@ -0,0 +1,9 @@ +Bootblog +======== + +This is the Bootstrap 3 [Blog theme](http://getbootstrap.com/examples/blog/), +adapted for Nikola. + +Some things require additional configuration (eg. the sidebar and the navbar). +Note that some things had to be substantially changed for this theme — for +example, menus are not ` + + + + + +
+
+
+

+ + %if logo_url: + + %endif + + % if show_blog_title: + ${blog_title} + % endif + +

+

${blog_description}

+ ${template_hooks['page_header']()} +
+ +
+
+ <%block name="content"> +
+
+ ${blog_sidebar} +
+ +
+
+
+ + + +${base.late_load_js()} + + + + + <%block name="extra_js"> + % 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']()} + + diff --git a/v7/bootblog/templates/base_helper.tmpl b/v7/bootblog/templates/base_helper.tmpl new file mode 100644 index 0000000..885d2ed --- /dev/null +++ b/v7/bootblog/templates/base_helper.tmpl @@ -0,0 +1,169 @@ +## -*- coding: utf-8 -*- + +<%namespace name="notes" file="annotation_helper.tmpl" import="*" /> +<%def name="html_headstart()"> + + + + + %if description: + + %endif + + ${title|striphtml} | ${blog_title|striphtml} + + ${html_stylesheets()} + ${html_feedlinks()} + %if permalink: + + %endif + + %if favicons: + %for name, file, size in favicons: + + %endfor + %endif + + % if comment_system == 'facebook': + + % endif + + %if prevlink: + + %endif + %if nextlink: + + %endif + + ${mathjax_config} + %if use_cdn: + + %else: + + %endif + + ${extra_head_data} + + +<%def name="late_load_js()"> + %if use_bundles: + %if use_cdn: + + + + %else: + + %endif + %else: + %if use_cdn: + + + %else: + + + + + %endif + + %endif + %if colorbox_locales[lang]: + + %endif + ${social_buttons_code} + + + +<%def name="html_stylesheets()"> + %if use_bundles: + %if use_cdn: + + + %else: + + %endif + %else: + %if use_cdn: + + %else: + + %endif + + + + + + %if has_custom_css: + + %endif + %endif + % if needs_ipython_css: + + + % 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 name="html_navigation_links()"> + %for url, text in navigation_links[lang]: + %if rel_link(permalink, url) == "#": + ${text} ${messages("(active)", lang)} + %else: + ${text} + %endif + %endfor + + +<%def name="html_feedlinks()"> + %if rss_link: + ${rss_link} + %elif generate_rss: + %if len(translations) > 1: + %for language in translations: + + %endfor + %else: + + %endif + %endif + %if generate_atom: + %if len(translations) > 1: + %for language in translations: + + %endfor + %else: + + %endif + %endif + + +<%def name="html_translations()"> + %for langname in translations.keys(): + %if langname != lang: + ${messages("LANGUAGE", langname)} + %endif + %endfor + diff --git a/v7/bootblog/templates/index.tmpl b/v7/bootblog/templates/index.tmpl new file mode 100644 index 0000000..352d516 --- /dev/null +++ b/v7/bootblog/templates/index.tmpl @@ -0,0 +1,42 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="index_helper.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> +<%inherit file="base.tmpl"/> + +<%block name="extra_head"> + ${parent.extra_head()} + % if posts and (permalink == '/' or permalink == '/' + index_file): + + % endif + + +<%block name="content"> +<%block name="content_header"> +
+% for post in posts: +
+
+

${post.title()|h}

+ +
+ %if index_teasers: +
+ ${post.text(teaser_only=True)} + %else: +
+ ${post.text(teaser_only=False)} + %endif +
+
+% endfor +
+${helper.html_pager()} +${comments.comment_link_script()} +${helper.mathjax_script(posts)} + diff --git a/v7/bootblog/templates/post.tmpl b/v7/bootblog/templates/post.tmpl new file mode 100644 index 0000000..156336a --- /dev/null +++ b/v7/bootblog/templates/post.tmpl @@ -0,0 +1,57 @@ +## -*- 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'): + + % endif + %if post.description(): + + %endif + + %if post.prev_post: + + %endif + %if post.next_post: + + %endif + % if post.is_draft: + + % endif + ${helper.open_graph_metadata(post)} + ${helper.twitter_card_information(post)} + ${helper.meta_translations(post)} + + +<%block name="content"> +
+ ${pheader.html_post_header()} +
+ ${post.text()} +
+ + % if not post.meta('nocomments') and site_has_comments: +
+

${messages("Comments")}

+ ${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)} +
+ % endif + ${helper.mathjax_script(post)} +
+${comments.comment_link_script()} + + +<%block name="sourcelink"> +% if show_sourcelink: + ${messages("Source")} +% endif + diff --git a/v7/bootblog/templates/post_header.tmpl b/v7/bootblog/templates/post_header.tmpl new file mode 100644 index 0000000..8b221ee --- /dev/null +++ b/v7/bootblog/templates/post_header.tmpl @@ -0,0 +1,49 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> + +<%def name="html_title()"> +%if title and not post.meta('hidetitle'): +

${post.title()|h}

+%endif + + +<%def name="html_translations(post)"> + % if len(post.translated_to) > 1: +
+

${messages("Also available in:")}

+ % for langname in translations.keys(): + % if langname != lang and post.is_translation_available(langname): +

${messages("LANGUAGE", langname)}

+ % endif + % endfor +
+ % endif + + +<%def name="html_sourcelink()"> + % if show_sourcelink: +

${messages("Source")}

+ % endif + + +<%def name="html_post_header()"> +
+ ${html_title()} +
+ + + % if not post.meta('nocomments') and site_has_comments: +

${comments.comment_link(post.permalink(), post._base_path)} + % endif + ${html_sourcelink()} + % if post.meta('link'): +

${messages("Original site")}

+ % endif + %if post.description(): + + %endif +
+ ${html_translations(post)} +
+