Skip to content

Commit f7b4ef7

Browse files
committedMay 29, 2015
hpstr
1 parent 3e42e73 commit f7b4ef7

13 files changed

+436
-0
lines changed
 

Diff for: ‎v7/hpstr/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
This theme is a quick port of the [HPSTR theme by Michael Rose](http://mmistakes.github.io/hpstr-jekyll-theme/) Everything that's good in it
2+
is Michael Rose's fault, everything bad is mine.
3+
4+
Known Issues:
5+
6+
* Not all features of Nikola are tested.
7+
* Galleries will work better when [Issue #1764](https://github.com/getnikola/nikola/issues/1764) is fixed.
8+
* CDNs are not used regardless of ``USE_CDN``
9+
* It doesn't yet support configuring the entry image in the frontpage
10+
* It doesn't yet support posts with "feature images"
11+
* It doesn't support USE_BUNDLES = True

Diff for: ‎v7/hpstr/assets/css/extra.css

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.sr-only {
2+
position: absolute;
3+
width: 1px;
4+
height: 1px;
5+
padding: 0;
6+
margin: -1px;
7+
overflow: hidden;
8+
clip: rect(0, 0, 0, 0);
9+
border: 0;
10+
}
11+
12+
.sr-only-focusable:active,
13+
.sr-only-focusable:focus {
14+
position: static;
15+
width: auto;
16+
height: auto;
17+
margin: 0;
18+
overflow: visible;
19+
clip: auto;
20+
}
21+
22+
.breadcrumb {
23+
padding: 8px 15px;
24+
margin-bottom: 20px;
25+
list-style: none;
26+
}
27+
28+
.breadcrumb > li {
29+
display: inline-block;
30+
margin-right: 0;
31+
margin-left: 0;
32+
}
33+
34+
.breadcrumb > li:after {
35+
content: ' / ';
36+
color: #888;
37+
}
38+
39+
.breadcrumb > li:last-of-type:after {
40+
content: '';
41+
margin-left: 0;
42+
}
43+
44+
.thumbnails > li {
45+
display: inline-block;
46+
margin-right: 10px;
47+
}
48+
49+
.thumbnails > li:last-of-type {
50+
margin-right: 0;
51+
}

Diff for: ‎v7/hpstr/assets/css/main.css

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

Diff for: ‎v7/hpstr/assets/js/modernizr-2.6.2.custom.min.js

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

Diff for: ‎v7/hpstr/assets/js/scripts.min.js

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

Diff for: ‎v7/hpstr/parent

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

Diff for: ‎v7/hpstr/templates/base.tmpl

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
${base.html_headstart()}
8+
<%block name="extra_head">
9+
### Leave this block alone.
10+
</%block>
11+
${template_hooks['extra_head']()}
12+
</head>
13+
<body id="post-index" class="feature">
14+
<a href="#content" class="sr-only sr-only-focusable">${messages("Skip to main content")}</a>
15+
${header.html_header()}
16+
<div id="main" role="main">
17+
<%block name="content"></%block>
18+
</div>
19+
${footer.html_footer()}
20+
${body_end}
21+
${template_hooks['body_end']()}
22+
${base.late_load_js()}
23+
</body>
24+
</html>

Diff for: ‎v7/hpstr/templates/base_footer.tmpl

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
4+
<%def name="html_footer()">
5+
%if content_footer:
6+
<div class="footer-wrapper">
7+
<footer role="contentinfo">
8+
<p>${content_footer}</p>
9+
${template_hooks['page_footer']()}
10+
</footer>
11+
</div>
12+
%endif
13+
</%def>

Diff for: ‎v7/hpstr/templates/base_header.tmpl

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
4+
<%def name="html_header()">
5+
${html_navigation_links()}
6+
<div class="entry-header">
7+
<!-- FIXME: get credit from settings -->
8+
<div class="image-credit">Image source: <a href="http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/">dargadgetz</a></div><!-- /.image-credit -->
9+
<div class="entry-image">
10+
<img src="//mmistakes.github.io/hpstr-jekyll-theme/images/abstract-1.jpg" alt="Latest Posts">
11+
</div><!-- /.entry-image -->
12+
${html_site_title()}
13+
</div><!-- /.entry-header -->
14+
</%def>
15+
16+
<%def name="html_site_title()">
17+
<div class="header-title">
18+
<div class="header-title-wrap">
19+
<h1 id="brand"><a href="${abs_link(_link("root", None, lang))}" title="${blog_title}" rel="home">
20+
${blog_title}</a></h1>
21+
<h2>${title}</h2>
22+
</div><!-- /.header-title-wrap -->
23+
</div><!-- /.header-title -->
24+
</%def>
25+
26+
<%def name="html_navigation_links()">
27+
<nav id="dl-menu" class="dl-menuwrapper" role="navigation">
28+
<button class="dl-trigger">Open Menu</button>
29+
<ul class="dl-menu">
30+
%for url, text in navigation_links[lang]:
31+
% if isinstance(url, tuple):
32+
<li>
33+
<a href="#">${text}</a>
34+
<ul class="dl-submenu">
35+
%for suburl, text in url:
36+
<li><a href="${suburl}">${text}</a></li>
37+
%endfor
38+
</ul>
39+
% else:
40+
<li><a href="${url}">${text}</a></li>
41+
% endif
42+
%endfor
43+
${template_hooks['menu']()}
44+
${template_hooks['menu_alt']()}
45+
</ul>
46+
</nav>
47+
</%def>
48+
49+
<%def name="html_translation_header()">
50+
%if len(translations) > 1:
51+
<div id="toptranslations">
52+
<h2>${messages("Languages:")}</h2>
53+
${base.html_translations()}
54+
</div>
55+
%endif
56+
</%def>

Diff for: ‎v7/hpstr/templates/base_helper.tmpl

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
## -*- coding: utf-8 -*-
2+
3+
<%def name="html_headstart()">
4+
<!DOCTYPE html>
5+
<html \
6+
prefix='\
7+
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
8+
og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
9+
%endif
10+
%if comment_system == 'facebook':
11+
fb: http://ogp.me/ns/fb#
12+
%endif
13+
' \
14+
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
15+
vocab="http://ogp.me/ns" \
16+
%endif
17+
% if is_rtl:
18+
dir="rtl" \
19+
% endif
20+
\
21+
lang="${lang}">
22+
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
23+
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
24+
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
25+
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
26+
<head>
27+
<meta charset="utf-8">
28+
%if description:
29+
<meta name="description" content="${description}">
30+
%endif
31+
<!-- http://t.co/dKP3o1e -->
32+
<meta name="HandheldFriendly" content="True">
33+
<meta name="MobileOptimized" content="320">
34+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
35+
<title>${title|striphtml} | ${blog_title|striphtml}</title>
36+
37+
38+
${html_stylesheets()}
39+
<!-- Load Modernizr -->
40+
<script src="//mmistakes.github.io/hpstr-jekyll-theme/assets/js/vendor/modernizr-2.6.2.custom.min.js"></script>
41+
${html_feedlinks()}
42+
%if permalink:
43+
<link rel="canonical" href="${abs_link(permalink)}">
44+
%endif
45+
46+
%if favicons:
47+
%for name, file, size in favicons:
48+
<link rel="${name}" href="${file}" sizes="${size}"/>
49+
%endfor
50+
%endif
51+
52+
% if comment_system == 'facebook':
53+
<meta property="fb:app_id" content="${comment_system_id}">
54+
% endif
55+
56+
%if prevlink:
57+
<link rel="prev" href="${prevlink}" type="text/html">
58+
%endif
59+
%if nextlink:
60+
<link rel="next" href="${nextlink}" type="text/html">
61+
%endif
62+
63+
${mathjax_config}
64+
%if use_cdn:
65+
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
66+
%else:
67+
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
68+
%endif
69+
70+
${extra_head_data}
71+
</%def>
72+
73+
<%def name="late_load_js()">
74+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
75+
<script src="/assets/js/scripts.min.js"></script>
76+
</%def>
77+
78+
<%def name="html_stylesheets()">
79+
%if use_bundles:
80+
%if use_cdn:
81+
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
82+
%else:
83+
<link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
84+
%endif
85+
%else:
86+
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
87+
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
88+
<link href="/assets/css/main.css" rel="stylesheet" type="text/css">
89+
<link href="/assets/css/extra.css" rel="stylesheet" type="text/css">
90+
%if has_custom_css:
91+
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
92+
%endif
93+
%endif
94+
<!-- Webfonts -->
95+
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">
96+
</%def>
97+
98+
<%def name="html_feedlinks()">
99+
%if rss_link:
100+
${rss_link}
101+
%elif generate_rss:
102+
%if len(translations) > 1:
103+
%for language in translations:
104+
<link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
105+
%endfor
106+
%else:
107+
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
108+
%endif
109+
%endif
110+
%if generate_atom:
111+
%if len(translations) > 1:
112+
%for language in translations:
113+
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
114+
%endfor
115+
%else:
116+
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
117+
%endif
118+
%endif
119+
</%def>
120+
121+
<%def name="html_translations()">
122+
<ul class="translations">
123+
%for langname in translations.keys():
124+
%if langname != lang:
125+
<li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
126+
%endif
127+
%endfor
128+
</ul>
129+
</%def>

Diff for: ‎v7/hpstr/templates/index.tmpl

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="index_helper.tmpl"/>
3+
<%namespace name="comments" file="comments_helper.tmpl"/>
4+
<%inherit file="base.tmpl"/>
5+
6+
<%block name="extra_head">
7+
${parent.extra_head()}
8+
% if posts and (permalink == '/' or permalink == '/' + index_file):
9+
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
10+
% endif
11+
</%block>
12+
13+
<%block name="content">
14+
<%block name="content_header"></%block>
15+
% for post in posts:
16+
<article class="hentry">
17+
<header>
18+
<div class="entry-meta">
19+
<span class="entry-date date published updated">
20+
<time datetime="${post.date.isoformat()}" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time>
21+
</span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
22+
<span class="byline author vcard">${post.author()}</span>
23+
% if not post.meta('nocomments') and site_has_comments:
24+
&nbsp;&nbsp;&middot;&nbsp;&nbsp;<span class="commentline">${comments.comment_link(post.permalink(), post._base_path)}
25+
% endif
26+
</div>
27+
<h1 class="p-name entry-title"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
28+
</header>
29+
%if index_teasers:
30+
<div class="p-summary entry-summary">
31+
${post.text(teaser_only=True)}
32+
%else:
33+
<div class="e-content entry-content">
34+
${post.text(teaser_only=False)}
35+
%endif
36+
</div>
37+
</article>
38+
% endfor
39+
${helper.html_pager()}
40+
${comments.comment_link_script()}
41+
${helper.mathjax_script(posts)}
42+
</%block>

Diff for: ‎v7/hpstr/templates/post.tmpl

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
<%inherit file="base.tmpl"/>
6+
7+
<%block name="extra_head">
8+
${parent.extra_head()}
9+
% if post.meta('keywords'):
10+
<meta name="keywords" content="${post.meta('keywords')|h}">
11+
% endif
12+
%if post.description():
13+
<meta name="description" content="${post.description()}">
14+
%endif
15+
<meta name="author" content="${post.author()}">
16+
%if post.prev_post:
17+
<link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()|h}" type="text/html">
18+
%endif
19+
%if post.next_post:
20+
<link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()|h}" type="text/html">
21+
%endif
22+
% if post.is_draft:
23+
<meta name="robots" content="noindex">
24+
% endif
25+
${helper.open_graph_metadata(post)}
26+
${helper.twitter_card_information(post)}
27+
${helper.meta_translations(post)}
28+
</%block>
29+
30+
<%block name="content">
31+
<article class="post-${post.meta('type')} h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article">
32+
${pheader.html_post_header()}
33+
<div class="e-content entry-content" itemprop="articleBody text">
34+
${post.text()}
35+
</div>
36+
<aside class="postpromonav">
37+
<nav>
38+
${helper.html_tags(post)}
39+
${helper.html_pager(post)}
40+
</nav>
41+
</aside>
42+
% if not post.meta('nocomments') and site_has_comments:
43+
<section class="comments">
44+
<h2>${messages("Comments")}</h2>
45+
${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)}
46+
</section>
47+
% endif
48+
${helper.mathjax_script(post)}
49+
</article>
50+
${comments.comment_link_script()}
51+
</%block>

Diff for: ‎v7/hpstr/templates/post_header.tmpl

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="comments" file="comments_helper.tmpl"/>
4+
5+
<%def name="html_title()">
6+
%if title and not post.meta('hidetitle'):
7+
<h1 class="p-name entry-title" itemprop="headline name"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
8+
%endif
9+
</%def>
10+
11+
<%def name="html_translations(post)">
12+
% if len(post.translated_to) > 1:
13+
<div class="metadata posttranslations translations">
14+
<h3 class="posttranslations-intro">${messages("Also available in:")}</h3>
15+
% for langname in translations.keys():
16+
% if langname != lang and post.is_translation_available(langname):
17+
<p><a href="${post.permalink(langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></p>
18+
% endif
19+
% endfor
20+
</div>
21+
% endif
22+
</%def>
23+
24+
<%def name="html_sourcelink()">
25+
% if show_sourcelink:
26+
<span class="sourceline"><a href="${post.source_link()}" id="sourcelink">${messages("Source")}</a></span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
27+
% endif
28+
</%def>
29+
30+
<%def name="html_post_header()">
31+
<header>
32+
<div class="entry-meta">
33+
<span class="dateline"><a href="${post.permalink()}" rel="bookmark"><time class="published dt-published" datetime="${post.date.isoformat()}" itemprop="datePublished" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></a></span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
34+
<span class="byline author vcard">${post.author()}</span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
35+
% if not post.meta('nocomments') and site_has_comments:
36+
<span class="commentline">${comments.comment_link(post.permalink(), post._base_path)}</span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
37+
% endif
38+
${html_sourcelink()}
39+
% if post.meta('link'):
40+
<span><a href='${post.meta('link')}'>${messages("Original site")}</a></span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
41+
% endif
42+
%if post.description():
43+
<meta name="description" itemprop="description" content="${post.description()}">
44+
%endif
45+
</div>
46+
${html_translations(post)}
47+
${html_title()}
48+
</header>
49+
</%def>

0 commit comments

Comments
 (0)
Please sign in to comment.