Skip to content
Permalink
Browse files
Modernize the zen family
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2018
1 parent cbd6a52 commit e962e41d939b59e5c89c161b988ca1477ebf8514
Showing 65 changed files with 5,273 additions and 1 deletion.
@@ -1277,7 +1277,8 @@
# USE_BUNDLES = True

# Plugins you don't want to use. Be careful :-)
DISABLED_PLUGINS = ["classify_indexes"]
DISABLED_PLUGINS = []
DISABLE_INDEXES = True

# Add the absolute paths to directories containing plugins to use them.
# For example, the `plugins` directory of your clone of the Nikola plugins
@@ -0,0 +1,3 @@
Damián Avila <https://github.com/damianavila>
Chris Warrick <https://github.com/Kwpolska>
Anke K <https://github.com/encarsia>
@@ -0,0 +1,11 @@
This is the `zen` theme modified to use icons from the [ForkAwesome](https://forkawesome.github.io) project instead of the originally used [FontAwesome](http://fontawesome.io) icons. Note that icon names and classes are different.

The zen and zen-based themes are very customizable, so to make these themes work, you have to use the sample config file.

More info about the zen themes family [here](http://www.damian.oquanta.info/posts/nikolas-zen-theme-finally-released.html).

Enjoy!

Damián

**WARNING:** The themes use Less for their styles, but you don't need a Less compiler installed to use it.
@@ -0,0 +1,8 @@
/* use Fork Awesome font family */

[class^="fa-"],
[class*=" fa-"],
.post .meta .authordate:before,
.post .meta .stats a:after {
font-family: ForkAwesome;
}
@@ -0,0 +1,4 @@
assets/css/all-nocdn.css=rst_base.css,nikola_rst.css,code.css,baguetteBox.min.css,theme.css,forkfont.css,custom.css
assets/css/all.css=rst_base.css,nikola_rst.css,code.css,baguetteBox.min.css,theme.css,custom.css
assets/js/all-nocdn.js=baguetteBox.min.js,moment-with-locales.min.js,fancydates.js
assets/js/all.js=fancydates.js
@@ -0,0 +1,11 @@
NAVIGATION_LINKS = {
DEFAULT_LANG: (
('/index.html', 'Home', 'fa fa-home'),
('/archive.html', 'Archives', 'fa fa-folder-open'),
('/categories/index.html', 'Tags', 'fa fa-tags'),
('/rss.xml', 'RSS', 'fa fa-rss'),
('https://getnikola.com', 'About me', 'fa fa-user'),
('https://twitter.com/getnikola', 'My Twitter', 'fa fa-twitter'),
('https://github.com/getnikola', 'My Github', 'fa fa-github'),
)
}
@@ -0,0 +1 @@
zen
@@ -0,0 +1,124 @@
## -*- coding: utf-8 -*-
<%namespace name="feeds_translations" file="feeds_translations_helper.tmpl" import="*"/>

<%def name="html_headstart()">
<!DOCTYPE html>
<html \
prefix='\
og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
%if comment_system == 'facebook':
fb: http://ogp.me/ns/fb# \
%endif
' \
vocab="http://ogp.me/ns" \
% if is_rtl:
dir="rtl" \
% endif
\
lang="${lang}">
<head>
<meta charset="utf-8">
%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
${feeds_translations.head(classification=None, kind='index', other=False)}
<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://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script><![endif]-->
%else:
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5shiv-printshiv.min.js', lang, url_type)}"></script><![endif]-->
%endif

${extra_head_data}
</%def>

<%def name="late_load_js()">
% if use_bundles:
% if use_cdn:
<script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>
% else:
<script src="/assets/js/all-nocdn.js"></script>
% endif
% else:
% if use_cdn:
<script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment-with-locales.min.js" integrity="sha256-ZykW30UBCXWkPGsVyVPdJlUrce9/PawgYCEzinA4pnU=" crossorigin="anonymous"></script>
% else:
<script src="/assets/js/baguetteBox.min.js"></script>
<script src="/assets/js/moment-with-locales.min.js"></script>
% endif
% endif
${social_buttons_code}
</%def>

<%def name="html_stylesheets()">
<link href="https://fonts.googleapis.com/css?family=Bitter:400,400i,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.0.11/css/fork-awesome.min.css" integrity="sha256-MGU/JUq/40CFrfxjXb5pZjpoZmxiP2KuICN5ElLFNd8=" crossorigin="anonymous">
%if use_bundles:
%if use_cdn:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />
<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:
<link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css">
<link href="/assets/css/rst_base.css" rel="stylesheet" type="text/css">
<link href="/assets/css/nikola_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 href="/assets/css/forkfont.css" rel="stylesheet" type="text/css">
%if has_custom_css:
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
%endif
%endif
% 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>

### This function is deprecated; use feed_helper directly.
<%def name="html_feedlinks()">
${feeds_translations.head(classification=None, kind='index', other=False)}
</%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>
@@ -0,0 +1,60 @@
## -*- 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"/>
<%namespace name="feeds_translations" file="feeds_translations_helper.tmpl" import="*"/>
<%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">
${feeds_translations.translation_link(kind)}
</%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="h-entry post-${post.meta('type')}" itemscope="itemscope" itemtype="http://schema.org/Article">
<header>
<h1 class="p-name entry-title"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
<div class="metadata">
<p class="dateline"><a href="${post.permalink()}" rel="bookmark"><i class="fa fa-clock-o"></i> <time class="published dt-published" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time></a></p>
<p class="byline author vcard"> <i class="fa fa-user"></i> <span class="byline-name fn" itemprop="author">
% if author_pages_generated:
<a href="${_link('author', post.author())}">${post.author()|h}</a>
% else:
${post.author()|h}
% endif
</span></p>
% if not post.meta('nocomments') and site_has_comments:
<p class="commentline"><i class="fa fa-comment"></i> ${comments.comment_link(post.permalink(), post._base_path)}
% endif
</div>
</header>
%if index_teasers:
<div class="p-summary entry-summary">
${post.text(teaser_only=True)}
%else:
<div class="e-content entry-content">
${post.text(teaser_only=False)}
%endif
</div>
</article>
% endfor
</div>
${helper.html_pager()}
${comments.comment_link_script()}
${math.math_scripts_ifposts(posts)}
</%block>
@@ -0,0 +1,49 @@
## -*- 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="${smartjoin(', ', 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.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_pager(post)}
</nav>
</aside>
% 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>
@@ -0,0 +1,9 @@
[Theme]
engine = mako
parent = zen
author = Damián Avila, Chris Warrick, Anke K
author_url = http://www.damian.oquanta.info/
license = MIT

[Family]
family = zen
@@ -0,0 +1,2 @@
Damián Avila <https://github.com/damianavila>
Chris Warrick <https://github.com/Kwpolska>
@@ -0,0 +1,11 @@
The zen and zen-based themes are very customizable, so to make these themes
work, you have to use the sample config file. The theme uses Font Awesome v5
icons.

More info about the zen themes family [here](http://www.damian.oquanta.info/posts/nikolas-zen-theme-finally-released.html).

Enjoy!

Damián

**WARNING:** The themes use Less for their styles, but you don't need a Less compiler installed to use it.

0 comments on commit e962e41

Please sign in to comment.