move to new theme canterville
This commit is contained in:
parent
302b5df4ef
commit
32036e0e4f
21 changed files with 2587 additions and 8 deletions
59
themes/canterville/templates/base.tmpl
Normal file
59
themes/canterville/templates/base.tmpl
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="base" file="base_helper.tmpl" import="*"/>
|
||||
<%namespace name="header" file="base_header.tmpl" import="*"/>
|
||||
<%namespace name="footer" file="base_footer.tmpl" import="*"/>
|
||||
${set_locale(lang)}
|
||||
${base.html_headstart()}
|
||||
<%block name="extra_head">
|
||||
### Leave this block alone.
|
||||
</%block>
|
||||
${template_hooks['extra_head']()}
|
||||
</head>
|
||||
<body class="nav-closed">
|
||||
${header.html_navigation_links()}
|
||||
<div class="site-wrapper">
|
||||
% if 'main_index' in pagekind and BANNER_URL :
|
||||
<header class="main-header" style="background-image: url(${BANNER_URL})">
|
||||
% elif 'post_page' in pagekind and post.meta('banner'):
|
||||
<header class="main-header" style="background-image: url(${post.meta('banner')})">
|
||||
% else:
|
||||
<header class="main-header post-head no-cover">
|
||||
% endif
|
||||
<nav class="main-nav overlay clearfix">
|
||||
<a class="blog-logo" href="${blog_url}"><img src="${logo_url}" alt="Blog Logo" /></a>
|
||||
<a class="menu-button" href="#"><span class="burger">☰</span><span class="word">Menu</span></a>
|
||||
</nav>
|
||||
% if 'main_index' in pagekind:
|
||||
<div class="vertical">
|
||||
<div class="main-header-content inner">
|
||||
% if GITHUB_URL:
|
||||
<a href="${GITHUB_URL}" target="_blank">
|
||||
<span class="icon-github" style="color:white;font-size:2em"></span>
|
||||
</a>
|
||||
|
||||
% endif
|
||||
% if TWITTER_URL:
|
||||
<a class="bloglogo" href=${TWITTER_URL} target="_blank">
|
||||
<span class="icon-twitter" style="color:white;font-size:2em"></span>
|
||||
</a>
|
||||
|
||||
% endif
|
||||
<h1 class="page-title">${title}</h1>
|
||||
<h2 class="page-description">${description}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<a class="scroll-down icon-arrow-left" href="#content"><span class="hidden">Scroll Down</span></a>
|
||||
% endif
|
||||
</header>
|
||||
|
||||
<main id="content" class="content" role="main">
|
||||
<%block name="content"></%block>
|
||||
</main>
|
||||
${footer.html_footer()}
|
||||
</div>
|
||||
${base.late_load_js()}
|
||||
<%block name="extra_js"></%block>
|
||||
${body_end}
|
||||
${template_hooks['body_end']()}
|
||||
</body>
|
||||
</html>
|
||||
11
themes/canterville/templates/base_footer.tmpl
Normal file
11
themes/canterville/templates/base_footer.tmpl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="base" file="base_helper.tmpl" import="*"/>
|
||||
|
||||
<%def name="html_footer()">
|
||||
%if content_footer:
|
||||
<footer class="site-footer clearfix">
|
||||
<section class="poweredby">${content_footer}</section>
|
||||
${template_hooks['page_footer']()}
|
||||
</footer>
|
||||
%endif
|
||||
</%def>
|
||||
60
themes/canterville/templates/base_header.tmpl
Normal file
60
themes/canterville/templates/base_header.tmpl
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="base" file="base_helper.tmpl" import="*"/>
|
||||
|
||||
<%def name="html_header()">
|
||||
<header id="header">
|
||||
${html_site_title()}
|
||||
${html_translation_header()}
|
||||
${html_navigation_links()}
|
||||
%if search_form:
|
||||
<div class="searchform" role="search">
|
||||
${search_form}
|
||||
</div>
|
||||
%endif
|
||||
</header>
|
||||
${template_hooks['page_header']()}
|
||||
</%def>
|
||||
|
||||
<%def name="html_site_title()">
|
||||
<h1 id="brand"><a href="${abs_link(_link("root", None, lang))}" title="${blog_title|h}" rel="home">
|
||||
%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></h1>
|
||||
</%def>
|
||||
|
||||
<%def name="html_navigation_links()">
|
||||
<div class="nav">
|
||||
<h3 class="nav-title">Menu</h3>
|
||||
<a href="#" class="nav-close">
|
||||
<span class="hidden">Close</span>
|
||||
</a>
|
||||
<ul>
|
||||
%for url, text in navigation_links[lang]:
|
||||
% if rel_link(permalink, url) == "#":
|
||||
<li class="nav-opened nav-current" role="presentation">
|
||||
% else:
|
||||
<li class="nav-opened" role="presentation">
|
||||
% endif
|
||||
<a href="${url}">${text}</a>
|
||||
</li>
|
||||
%endfor
|
||||
${template_hooks['menu']()}
|
||||
${template_hooks['menu_alt']()}
|
||||
</ul>
|
||||
</div>
|
||||
<span class="nav-cover"></span>
|
||||
</%def>
|
||||
|
||||
<%def name="html_translation_header()">
|
||||
%if len(translations) > 1:
|
||||
<div id="toptranslations">
|
||||
<h2>${messages("Languages:")}</h2>
|
||||
${base.html_translations()}
|
||||
</div>
|
||||
%endif
|
||||
</%def>
|
||||
121
themes/canterville/templates/base_helper.tmpl
Normal file
121
themes/canterville/templates/base_helper.tmpl
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
|
||||
<%def name="html_headstart()">
|
||||
<!DOCTYPE html>
|
||||
<html \
|
||||
prefix='\
|
||||
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
|
||||
og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
|
||||
%endif
|
||||
%if comment_system == 'facebook':
|
||||
fb: http://ogp.me/ns/fb#
|
||||
%endif
|
||||
' \
|
||||
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
|
||||
vocab="http://ogp.me/ns" \
|
||||
%endif
|
||||
% if is_rtl:
|
||||
dir="rtl" \
|
||||
% endif
|
||||
\
|
||||
lang="${lang}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
% if use_base_tag:
|
||||
<base href="${abs_link(permalink)}">
|
||||
% endif
|
||||
%if description:
|
||||
<meta name="description" content="${description|h}">
|
||||
%endif
|
||||
<meta name="viewport" content="width=device-width">
|
||||
%if title == blog_title:
|
||||
<title>${blog_title|h}</title>
|
||||
%else:
|
||||
<title>${title|h} | ${blog_title|h}</title>
|
||||
%endif
|
||||
|
||||
${html_stylesheets()}
|
||||
<meta name="theme-color" content="${theme_color}">
|
||||
% if meta_generator_tag:
|
||||
<meta name="generator" content="Nikola (getnikola.com)">
|
||||
% endif
|
||||
${html_feedlinks()}
|
||||
<link rel="canonical" href="${abs_link(permalink)}">
|
||||
|
||||
%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
|
||||
|
||||
%if prevlink:
|
||||
<link rel="prev" href="${prevlink}" type="text/html">
|
||||
%endif
|
||||
%if nextlink:
|
||||
<link rel="next" href="${nextlink}" type="text/html">
|
||||
%endif
|
||||
|
||||
%if use_cdn:
|
||||
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
%else:
|
||||
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang, url_type)}"></script><![endif]-->
|
||||
%endif
|
||||
|
||||
${extra_head_data}
|
||||
</%def>
|
||||
|
||||
<%def name="late_load_js()">
|
||||
<script type="text/javascript" src="/assets/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/assets/js/jquery.fitvids.js"></script>
|
||||
<script type="text/javascript" src="/assets/js/index.js"></script>
|
||||
</%def>
|
||||
|
||||
<%def name="html_stylesheets()">
|
||||
<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/theme.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/screen.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/nav.css" />
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400|Inconsolata" />
|
||||
% 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
|
||||
</%def>
|
||||
|
||||
<%def name="html_feedlinks()">
|
||||
%if rss_link:
|
||||
${rss_link}
|
||||
%elif generate_rss:
|
||||
%if len(translations) > 1:
|
||||
%for language in sorted(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 generate_atom:
|
||||
%if len(translations) > 1:
|
||||
%for language in sorted(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
|
||||
</%def>
|
||||
|
||||
<%def name="html_translations()">
|
||||
<ul class="translations">
|
||||
%for langname in sorted(translations):
|
||||
%if langname != lang:
|
||||
<li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
|
||||
%endif
|
||||
%endfor
|
||||
</ul>
|
||||
</%def>
|
||||
62
themes/canterville/templates/index.tmpl
Normal file
62
themes/canterville/templates/index.tmpl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="helper" file="index_helper.tmpl"/>
|
||||
<%namespace name="math" file="math_helper.tmpl"/>
|
||||
<%namespace name="comments" file="comments_helper.tmpl"/>
|
||||
<%namespace name="pagination" file="pagination_helper.tmpl"/>
|
||||
<%inherit file="base.tmpl"/>
|
||||
|
||||
<%block name="extra_head">
|
||||
${parent.extra_head()}
|
||||
% if posts and (permalink == '/' or permalink == '/' + index_file):
|
||||
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
|
||||
% endif
|
||||
${math.math_styles_ifposts(posts)}
|
||||
</%block>
|
||||
|
||||
<%block name="content">
|
||||
<%block name="content_header"></%block>
|
||||
% if 'main_index' in pagekind:
|
||||
${front_index_header}
|
||||
% endif
|
||||
% if page_links:
|
||||
${pagination.page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)}
|
||||
% endif
|
||||
<div class="postindex">
|
||||
% for post in posts:
|
||||
|
||||
|
||||
<article class="post post">
|
||||
<header class="post-header">
|
||||
<h2 class="post-title"><a href="${post.permalink()}">${post.title()|h}</a></h2>
|
||||
</header>
|
||||
%if index_teasers:
|
||||
<section class="post-excerpt">
|
||||
${post.text(teaser_only=True)}
|
||||
%else:
|
||||
<section class="post-excerpt">
|
||||
${post.text(teaser_only=False)}
|
||||
%endif
|
||||
</section>
|
||||
<footer class="post-meta">
|
||||
% if author_pages_generated:
|
||||
<a href="${_link('author', post.author())}">${post.author()|h}</a>
|
||||
% else:
|
||||
${post.author()|h}
|
||||
% endif
|
||||
|
||||
on
|
||||
% for tag in post.tags:
|
||||
<a href="link://tag/${tag}">#${tag}</a>,
|
||||
% endfor
|
||||
|
||||
<time class="post-date" datetime="${post.formatted_date('webiso')}">
|
||||
${post.formatted_date(date_format)|h}
|
||||
</time>
|
||||
</footer>
|
||||
</article>
|
||||
% endfor
|
||||
</div>
|
||||
${helper.html_pager()}
|
||||
${comments.comment_link_script()}
|
||||
${math.math_scripts_ifposts(posts)}
|
||||
</%block>
|
||||
63
themes/canterville/templates/post.tmpl
Normal file
63
themes/canterville/templates/post.tmpl
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="helper" file="post_helper.tmpl"/>
|
||||
<%namespace name="pheader" file="post_header.tmpl"/>
|
||||
<%namespace name="comments" file="comments_helper.tmpl"/>
|
||||
<%namespace name="math" file="math_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()|h}">
|
||||
%if post.prev_post:
|
||||
<link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()|h}" type="text/html">
|
||||
%endif
|
||||
%if post.next_post:
|
||||
<link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()|h}" type="text/html">
|
||||
%endif
|
||||
% if post.is_draft:
|
||||
<meta name="robots" content="noindex">
|
||||
% endif
|
||||
${helper.open_graph_metadata(post)}
|
||||
${helper.twitter_card_information(post)}
|
||||
${helper.meta_translations(post)}
|
||||
${math.math_styles_ifpost(post)}
|
||||
</%block>
|
||||
|
||||
<%block name="content">
|
||||
|
||||
<article class="post post">
|
||||
<header class="post-header">
|
||||
<h1 class="post-title">${post.title()}</h1>
|
||||
<section class="post-meta"> by
|
||||
% if author_pages_generated:
|
||||
<a href="${_link('author', post.author())}">${post.author()|h}</a>
|
||||
% else:
|
||||
${post.author()|h}
|
||||
% endif
|
||||
on
|
||||
% for tag in post.tags:
|
||||
<a href="link://tag/${tag}">#${tag}</a>,
|
||||
% endfor
|
||||
<time class="post-date" datetime="${post.formatted_date('webiso')}">
|
||||
${post.formatted_date(date_format)|h}
|
||||
</time>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
<section class="post-content">
|
||||
${post.text()}
|
||||
</section>
|
||||
<footer class="post-footer">
|
||||
% if not post.meta('nocomments') and site_has_comments:
|
||||
<section class="comments hidden-print">
|
||||
<h2>${messages("Comments")}</h2>
|
||||
${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)}
|
||||
</section>
|
||||
% endif
|
||||
${math.math_scripts_ifpost(post)}
|
||||
</article>
|
||||
${comments.comment_link_script()}
|
||||
</%block>
|
||||
Loading…
Add table
Add a link
Reference in a new issue