move to new theme canterville

This commit is contained in:
Don Harper 2019-04-12 22:46:00 -05:00
parent 302b5df4ef
commit 32036e0e4f
21 changed files with 2587 additions and 8 deletions

25
conf.py
View file

@ -15,7 +15,7 @@ TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
NAVIGATION_LINKS = {
DEFAULT_LANG: (
('/', 'Home'),
('/stories/about/', 'About me'),
('/stories/about.html', 'About me'),
('https://www.duckland.org', 'My Personal and Tech Blog'),
#(
#(
@ -36,15 +36,26 @@ NAVIGATION_LINKS = {
#),
("/archive.html", "Archive"),
("/categories/", "Tags"),
("/stories/privacy/", "Privacy/GDPR"),
("/stories/privacy.html", "Privacy/GDPR"),
('/rss.xml', 'RSS'),
),
}
THEME = "hyde"
#THEME = "hyde"
#GLOBAL_CONTEXT = {'HACK_VARIANT': 'dark'}
GLOBAL_CONTEXT_FILLER = []
THEME = 'canterville'
LOGO_URL = 'https://getnikola.com/assets/img/logo.svg'
GLOBAL_CONTEXT = {
'TWITTER_URL': 'https://twitter.com/duckunix',
'FLICKR_URL': 'https://www.flickr.com/photos/duckunix/',
'BANNER_URL': '/assets/img/road.jpg'
#'BANNER_URL': '/assets/img/silk-road.jpg'
}
TIMEZONE = "CDT6CST"
DATE_FORMAT = 'YYYY-MM-dd'
JS_DATE_FORMAT = 'YYYY-MM-dd'
DATE_FANCINESS = 1
#DATE_FORMAT = "YYYY-MM-dd"
#DATE_FORMAT = 'short'
#JS_DATE_FORMAT = 'YYYY-MM-dd HH:mm'
DATE_FANCINESS = 0
POSTS = (
("posts/*.rst", "posts", "post.tmpl"),
("posts/*.md", "posts", "post.tmpl"),
@ -104,7 +115,5 @@ LOGGING_HANDLERS = {
'smtp': { 'from_addr': 'www.donaldharper.com@duckland.org', 'recipients': ('duck@duckland.org'), 'server_addr': ('127.0.0.1',25), 'secure': (), 'level': 'WARNING', 'bubble': False
}
}
GLOBAL_CONTEXT = {'HACK_VARIANT': 'dark'}
GLOBAL_CONTEXT_FILLER = []
CREATE_MONTHLY_ARCHIVE = True
WRITE_TAG_CLOUD = False

View file

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2017 Roberto Alsina, Valere Jeantet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,14 @@
A port of the Casper theme from Ghost, via https://github.com/vjeantet/hugo-theme-casper/
License is MIT
Included is a copy of Genericons, which is GPLv2
The Silk Road image is CC licensed from
[Jonathan Kos-Read](http://www.flickr.com/photos/jonathankosread/)
Special variables
* TWITTER_URL
* GITHUB_URL
* BANNER_URL

View file

@ -0,0 +1,108 @@
nav.breadcrumb{
margin-bottom:0px;
}
nav.breadcrumb li {
display: inline ;
font-size: 14px;
font-family: helvetica;
}
nav.breadcrumb li a {
text-decoration: none;
}
nav.breadcrumb li a:after {
content: " >";
}
nav.navpage {
font-size: 1em;
font-family: helvetica;
width: 100%;
}
nav.navpage > ul {
background: #efefef;
background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%);
box-shadow: 0px 0px 90px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
width: 100%;
}
nav.navpage li {
list-style: none;
}
nav.navpage:after {
content: ""; clear: both; display: block;
}
nav.navpage > ul > li > a {
font-weight: bold;
text-decoration: none;
font-size: 1.2em;
font-variant: small-caps;
}
nav.navpage ul {
padding-left: 0px;
margin-left: 0px;
}
nav.navpage ul ul li {
display: block;
margin-left: 30px;
line-height: 1.2em;
}
nav.navpage ul ul li a {
text-decoration: none
}
nav.navpage ul ul li a:hover {
text-decoration: underline;
}
nav.navpage ul ul li:after {
content: "";
}
nav.navpage ul ul li ul li{
display: block;
font-size: smaller;
margin-left: 30px;
line-height: 1.1em;
}
nav.navchildren{
margin-top: 0px;
background: #efefef;
background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%);
box-shadow: 0px 0px 90px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
width: 100%;
}
nav.navchildren li {
font-size: smaller;
line-height: 1.1em;
font-family: helvetica;
/*display: block;*/
}
nav.navchildren a {
line-height: 1.1em;
text-decoration: none
}
nav.navchildren a:hover {
text-decoration: underline;
}

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

View file

@ -0,0 +1,56 @@
/**
* Main JS file for Casper behaviours
*/
/* globals jQuery, document */
(function ($, undefined) {
"use strict";
var $document = $(document);
$document.ready(function () {
var $postContent = $(".post-content");
$postContent.fitVids();
$(".scroll-down").arctic_scroll();
$(".menu-button[href='#'], .nav-cover, .nav-close").on("click", function(e){
e.preventDefault();
$("body").toggleClass("nav-opened nav-closed");
});
});
// Arctic Scroll by Paul Adam Davis
// https://github.com/PaulAdamDavis/Arctic-Scroll
$.fn.arctic_scroll = function (options) {
var defaults = {
elem: $(this),
speed: 500
},
allOptions = $.extend(defaults, options);
allOptions.elem.click(function (event) {
event.preventDefault();
var $this = $(this),
$htmlBody = $('html, body'),
offset = ($this.attr('data-offset')) ? $this.attr('data-offset') : false,
position = ($this.attr('data-position')) ? $this.attr('data-position') : false,
toMove;
if (offset) {
toMove = parseInt(offset);
$htmlBody.stop(true, false).animate({scrollTop: ($(this.hash).offset().top + toMove) }, allOptions.speed);
} else if (position) {
toMove = parseInt(position);
$htmlBody.stop(true, false).animate({scrollTop: toMove }, allOptions.speed);
} else {
$htmlBody.stop(true, false).animate({scrollTop: ($(this.hash).offset().top) }, allOptions.speed);
}
});
};
})(jQuery);

View file

@ -0,0 +1,67 @@
/*global jQuery */
/*jshint browser:true */
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
(function( $ ){
"use strict";
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null
};
if(!document.getElementById('fit-vids-style')) {
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
var head = document.head || document.getElementsByTagName('head')[0];
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div = document.createElement('div');
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
head.appendChild(div.childNodes[1]);
}
if ( options ) {
$.extend( settings, options );
}
return this.each(function(){
var selectors = [
"iframe[src*='player.vimeo.com']",
"iframe[src*='youtube.com']",
"iframe[src*='youtube-nocookie.com']",
"iframe[src*='kickstarter.com'][src*='video.html']",
"object",
"embed"
];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var $allVideos = $(this).find(selectors.join(','));
$allVideos = $allVideos.not("object object"); // SwfObj conflict patch
$allVideos.each(function(){
var $this = $(this);
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if(!$this.attr('id')){
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
$this.attr('id', videoID);
}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
$this.removeAttr('height').removeAttr('width');
});
});
};
// Works with either jQuery or Zepto
})( window.jQuery || window.Zepto );

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
[Theme]
engine = mako
parent = base
author = Roberto Alsina, Valere Jeantet
author_url = http://ralsina.me/
based_on = Casper for Hugo <https://github.com/vjeantet/hugo-theme-casper/>
license = MIT

View file

@ -0,0 +1,7 @@
THEME = 'canterville'
LOGO_URL = 'https://getnikola.com/assets/img/logo.svg'
GLOBAL_CONTEXT = {
'TWITTER_URL': 'https://twitter.com/getnikola',
'GITHUB_URL': 'https://github.com/getnikola',
'BANNER_URL': '/assets/img/silk-road.jpg'
}

View file

@ -0,0 +1 @@
base

View 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">&#9776;</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>
&nbsp;
% endif
% if TWITTER_URL:
<a class="bloglogo" href=${TWITTER_URL} target="_blank">
<span class="icon-twitter" style="color:white;font-size:2em"></span>
</a>
&nbsp;
% 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>

View 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>

View 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>

View 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>

View 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>

View 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>