Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 34c6b14

Browse files
author
Roberto Alsina
committedMay 16, 2017
New Hemingway theme
1 parent df1211e commit 34c6b14

File tree

9 files changed

+209
-0
lines changed

9 files changed

+209
-0
lines changed
 

‎v7/hemingway/LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Asuka Suzuki
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.

‎v7/hemingway/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
A port of Hugo's Hemingway theme by tanksuzuki to Nikola.
2+
3+
Original theme: https://themes.gohugo.io/hemingway/
4+
5+
License is MIT
6+
7+
The navigation menu has no text, only ``(link, class)`` where class
8+
is a Font Awesome class, like ``"fa fa-github"``

‎v7/hemingway/assets/css/style.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎v7/hemingway/conf.py.sample

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
INDEX_READ_MORE_LINK = '<a class="button is-link" href="{link}" style="height:28px"> {read_more} <span class="icon is-small"> <i class="fa fa-angle-double-right"></i></span></a>'
2+
NAVIGATION_LINKS = {
3+
DEFAULT_LANG: (
4+
("http://twitter.com/getnikola", "fa fa-twitter"),
5+
("http://github.com/getnikola", "fa fa-github"),
6+
("/rss.xml", "fa fa-rss"),
7+
),
8+
}

‎v7/hemingway/parent

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base

‎v7/hemingway/templates/base.tmpl

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
<%namespace name="header" file="base_header.tmpl" import="*"/>
4+
<%namespace name="footer" file="base_footer.tmpl" import="*"/>
5+
<%namespace name="annotations" file="annotation_helper.tmpl"/>
6+
${set_locale(lang)}
7+
8+
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
9+
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
10+
<link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
11+
%if has_custom_css:
12+
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
13+
%endif
14+
% if needs_ipython_css:
15+
<link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">
16+
<link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
17+
% endif
18+
<link rel="stylesheet" href="/assets/css/style.css">
19+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
20+
<%block name="extra_head">
21+
### Leave this block alone.
22+
</%block>
23+
${template_hooks['extra_head']()}
24+
</head>
25+
<body>
26+
27+
<section class="section">
28+
<div class="container">
29+
<nav class="nav">
30+
<div class="nav-left">
31+
<a class="nav-item" href="${blog_url}"><h1 class="title is-4">${blog_title}</h1></a>
32+
</div>
33+
<div class="nav-right">
34+
<nav class="nav-item level is-mobile">
35+
% for link, icon in navigation_links[lang]:
36+
<a class="level-item" href="${link}">
37+
<span class="icon">
38+
<i class="${icon}"></i>
39+
</span>
40+
</a>
41+
% endfor
42+
</nav>
43+
</div>
44+
</nav>
45+
</div>
46+
</section>
47+
48+
<%block name="content"></%block>
49+
50+
<section class="section">
51+
%if content_footer:
52+
<div class="container has-text-centered">
53+
<p>${content_footer}</p>
54+
${template_hooks['page_footer']()}
55+
</div>
56+
%endif
57+
</section>
58+
59+
${base.late_load_js()}
60+
<%block name="extra_js"></%block>
61+
${body_end}
62+
${template_hooks['body_end']()}
63+
</body>
64+
</html>

‎v7/hemingway/templates/index.tmpl

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="index_helper.tmpl"/>
3+
<%namespace name="math" file="math_helper.tmpl"/>
4+
<%namespace name="comments" file="comments_helper.tmpl"/>
5+
<%namespace name="pagination" file="pagination_helper.tmpl"/>
6+
<%inherit file="base.tmpl"/>
7+
8+
<%block name="extra_head">
9+
${parent.extra_head()}
10+
% if posts and (permalink == '/' or permalink == '/' + index_file):
11+
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
12+
% endif
13+
${math.math_styles_ifposts(posts)}
14+
</%block>
15+
16+
<%block name="content">
17+
<%block name="content_header"></%block>
18+
% if 'main_index' in pagekind:
19+
${front_index_header}
20+
% endif
21+
% if page_links:
22+
${pagination.page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)}
23+
% endif
24+
<section>
25+
<div class="container">
26+
% for post in posts:
27+
28+
<article>
29+
<h2 class="subtitle is-6">${post.formatted_date(date_format)|h}</h2>
30+
<h1 class="title"><a href="${post.permalink()}">${post.title()|h}</a></h1>
31+
<div class="content">
32+
%if index_teasers:
33+
${post.text(teaser_only=True)}
34+
%else:
35+
${post.text(teaser_only=False)}
36+
%endif
37+
</div>
38+
</article>
39+
% endfor
40+
41+
</div>
42+
</section>
43+
${helper.html_pager()}
44+
</%block>

‎v7/hemingway/templates/post.tmpl

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="pheader" file="post_header.tmpl"/>
4+
<%namespace name="comments" file="comments_helper.tmpl"/>
5+
<%namespace name="math" file="math_helper.tmpl"/>
6+
<%inherit file="base.tmpl"/>
7+
8+
<%block name="extra_head">
9+
${parent.extra_head()}
10+
% if post.meta('keywords'):
11+
<meta name="keywords" content="${post.meta('keywords')|h}">
12+
% endif
13+
<meta name="author" content="${post.author()|h}">
14+
%if post.prev_post:
15+
<link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()|h}" type="text/html">
16+
%endif
17+
%if post.next_post:
18+
<link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()|h}" type="text/html">
19+
%endif
20+
% if post.is_draft:
21+
<meta name="robots" content="noindex">
22+
% endif
23+
${helper.open_graph_metadata(post)}
24+
${helper.twitter_card_information(post)}
25+
${helper.meta_translations(post)}
26+
${math.math_styles_ifpost(post)}
27+
</%block>
28+
29+
<%block name="content">
30+
31+
<section class="section">
32+
<div class="container">
33+
<h2 class="subtitle is-6">${post.formatted_date(date_format)|h}</h2>
34+
<h1 class="title">${post.title()|h}</h1>
35+
<div class="content">
36+
${post.text()}
37+
</div>
38+
</div>
39+
</section>
40+
% if not post.meta('nocomments') and site_has_comments:
41+
<section class="section comments hidden-print">
42+
<h2>${messages("Comments")}</h2>
43+
${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)}
44+
</section>
45+
% endif
46+
${math.math_styles_ifpost(post)}
47+
${comments.comment_link_script()}
48+
</%block>

‎v7/hemingway/templates/story.tmpl

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="pheader" file="post_header.tmpl"/>
4+
<%namespace name="comments" file="comments_helper.tmpl"/>
5+
<%namespace name="math" file="math_helper.tmpl"/>
6+
<%inherit file="post.tmpl"/>
7+
8+
<%block name="content">
9+
<section class="section">
10+
<div class="container">
11+
<h2 class="subtitle is-6">${post.formatted_date(date_format)|h}</h2>
12+
<h1 class="title">${post.title()|h}</h1>
13+
<div class="content">
14+
${post.text()}
15+
</div>
16+
</div>
17+
</section>
18+
% if not post.meta('nocomments') and site_has_comments:
19+
<section class="section comments hidden-print">
20+
<h2>${messages("Comments")}</h2>
21+
${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)}
22+
</section>
23+
% endif
24+
${math.math_styles_ifpost(post)}
25+
${comments.comment_link_script()}
26+
</%block>

0 commit comments

Comments
 (0)
Please sign in to comment.