Skip to content

Commit 5889d4c

Browse files
committed
Start from the HPSTR Jekyll Theme.
1 parent 7d42241 commit 5889d4c

File tree

104 files changed

+9129
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+9129
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
_site
2+
.DS_Store
3+
*.sublime-project
4+
*.sublime-workspace
5+
codekit-config.json
6+
node_modules
7+
Gemfile.lock
8+
.sass-cache

.jshintrc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"bitwise": true,
3+
"browser": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"eqnull": true,
7+
"es5": false,
8+
"esnext": true,
9+
"immed": true,
10+
"jquery": true,
11+
"latedef": true,
12+
"newcap": true,
13+
"noarg": true,
14+
"node": true,
15+
"strict": false,
16+
"trailing": false,
17+
"undef": true,
18+
"multistr": true,
19+
"expr": true
20+
}

404.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: page
3+
title: "Page Not Found"
4+
description: "Page not found. Your pixels are in another canvas."
5+
comments: false
6+
share: false
7+
permalink: /404.html
8+
---
9+
10+
Sorry, but the page you were trying to view does not exist --- perhaps you can try searching for it below.
11+
12+
<script type="text/javascript">
13+
var GOOG_FIXURL_LANG = 'en';
14+
var GOOG_FIXURL_SITE = '{{ site.url }}'
15+
</script>
16+
<script type="text/javascript"
17+
src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">
18+
</script>

Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'jekyll'
4+
gem 'sass'
5+
gem 'octopress', '~> 3.0.0.rc.12'
6+
gem 'jekyll-sitemap'

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# HPSTR Jekyll Theme
2+
3+
They say three times the charm, so here is another free responsive Jekyll theme for you. I've learned a ton since open sourcing [my first two themes](https://mademistakes.com/work/jekyll-themes/), and wanted to try a few new things this time around. If you've used my previous themes most of this should be familiar territory.
4+
5+
## What HPSTR brings to the table:
6+
7+
* Modern and minimal design.
8+
* Responsive templates for post, page, and post index `_layouts`. Looks great on mobile, tablet, and desktop devices.
9+
* Gracefully degrades in older browsers. Compatible with Internet Explorer 8+ and all modern browsers.
10+
* Sweet animated menu with support for drop-downs.
11+
* Optional [Disqus](http://disqus.com) comments and social sharing links.
12+
* [Open Graph](https://developers.facebook.com/docs/opengraph/) and [Twitter Cards](https://dev.twitter.com/docs/cards) support for a better social sharing experience.
13+
* Simple [custom 404 page](http://mmistakes.github.io/hpstr-jekyll-theme/404.html) to get you started.
14+
* Stylesheets for Pygments and Coderay [syntax highlighting](http://mmistakes.github.io/hpstr-jekyll-theme/code-highlighting-post/) to make your code examples look snazzy
15+
* [Available in Spanish](https://github.com/cruznick/hpstr-jekyll-theme/tree/es). Thanks [@cruznick](https://github.com/cruznick)!
16+
17+
![HPSTR Theme Preview screenshot](http://mmistakes.github.io/hpstr-jekyll-theme/images/hpstr-jekyll-theme-preview.jpg)
18+
19+
---
20+
21+
## Getting Started
22+
23+
HPSTR takes advantage of Sass and data files to make customizing easier. These features require Jekyll 2.x and will not work with older versions of Jekyll.
24+
25+
To learn how to install and use this theme check out the [Setup Guide](https://mmistakes.github.io/hpstr-jekyll-theme/theme-setup/) for more information.

Rakefile.rb

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
require "rubygems"
2+
require "bundler/setup"
3+
require "stringex"
4+
5+
## -- Config -- ##
6+
7+
public_dir = "public" # compiled site directory
8+
posts_dir = "_posts" # directory for blog files
9+
new_post_ext = "md" # default new post file extension when using the new_post task
10+
new_page_ext = "md" # default new page file extension when using the new_page task
11+
12+
13+
#############################
14+
# Create a new Post or Page #
15+
#############################
16+
17+
# usage rake new_post
18+
desc "Create a new post in #{posts_dir}"
19+
task :new_post, :title do |t, args|
20+
if args.title
21+
title = args.title
22+
else
23+
title = get_stdin("Enter a title for your post: ")
24+
end
25+
filename = "#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
26+
if File.exist?(filename)
27+
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
28+
end
29+
tags = get_stdin("Enter tags to classify your post (comma separated): ")
30+
puts "Creating new post: #{filename}"
31+
open(filename, 'w') do |post|
32+
post.puts "---"
33+
post.puts "layout: post"
34+
post.puts "title: \"#{title.gsub(/&/,'&amp;')}\""
35+
post.puts "modified: #{Time.now.strftime('%Y-%m-%d %H:%M:%S %z')}"
36+
post.puts "tags: [#{tags}]"
37+
post.puts "image:"
38+
post.puts " feature: "
39+
post.puts " credit: "
40+
post.puts " creditlink: "
41+
post.puts "comments: "
42+
post.puts "share: "
43+
post.puts "---"
44+
end
45+
end
46+
47+
# usage rake new_page
48+
desc "Create a new page"
49+
task :new_page, :title do |t, args|
50+
if args.title
51+
title = args.title
52+
else
53+
title = get_stdin("Enter a title for your page: ")
54+
end
55+
filename = "#{title.to_url}.#{new_page_ext}"
56+
if File.exist?(filename)
57+
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
58+
end
59+
tags = get_stdin("Enter tags to classify your page (comma separated): ")
60+
puts "Creating new page: #{filename}"
61+
open(filename, 'w') do |page|
62+
page.puts "---"
63+
page.puts "layout: page"
64+
page.puts "permalink: /#{title.to_url}/"
65+
page.puts "title: \"#{title}\""
66+
page.puts "modified: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
67+
page.puts "tags: [#{tags}]"
68+
page.puts "image:"
69+
page.puts " feature: "
70+
page.puts " credit: "
71+
page.puts " creditlink: "
72+
page.puts "share: "
73+
page.puts "---"
74+
end
75+
end
76+
77+
def get_stdin(message)
78+
print message
79+
STDIN.gets.chomp
80+
end
81+
82+
def ask(message, valid_options)
83+
if valid_options
84+
answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
85+
else
86+
answer = get_stdin(message)
87+
end
88+
answer
89+
end

_config.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
title: Site Title
2+
description: Describe your website here.
3+
disqus_shortname: hpstrtheme
4+
reading_time: true
5+
words_per_minute: 200
6+
# Your site's domain goes here (eg: //mmistakes.github.io, http://mademistakes.com, etc)
7+
# When testing locally leave blank or use http://localhost:4000
8+
url:
9+
10+
# Owner/author information
11+
owner:
12+
name: Your Name
13+
avatar: avatar.jpg
14+
bio: "Your bio goes here. It shouldn't be super long but a good two sentences or two should suffice."
15+
email: you@email.com
16+
# Social networking links used in footer. Update and remove as you like.
17+
twitter:
18+
facebook:
19+
github:
20+
stackexchange:
21+
linkedin:
22+
instagram:
23+
flickr:
24+
tumblr:
25+
# google plus id, include the '+', eg +mmistakes
26+
google_plus: +yourid
27+
28+
# Background image to be tiled on all pages
29+
background:
30+
31+
# Analytics and webmaster tools stuff goes here
32+
google_analytics:
33+
google_verify:
34+
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
35+
bing_verify:
36+
37+
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
38+
timezone: America/New_York
39+
future: true
40+
highlighter: pygments
41+
markdown: kramdown
42+
gems:
43+
- jekyll-sitemap
44+
sass:
45+
sass_dir: _sass
46+
style: compressed
47+
48+
# https://github.com/mojombo/jekyll/wiki/Permalinks
49+
permalink: /:categories/:title/
50+
51+
# Amount of post to show on home page
52+
paginate: 5
53+
54+
kramdown:
55+
auto_ids: true
56+
footnote_nr: 1
57+
entity_output: as_char
58+
toc_levels: 1..6
59+
use_coderay: true
60+
61+
coderay:
62+
coderay_line_numbers: nil
63+
coderay_line_numbers_start: 1
64+
coderay_tab_width: 4
65+
coderay_bold_every: 10
66+
coderay_css: class
67+
68+
include: [".htaccess"]
69+
exclude: ["lib", "config.rb", "Capfile", "config", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules"]

_data/navigation.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Menu navigation links
2+
3+
- title: Theme Setup
4+
url: /theme-setup/
5+
6+
- title: External Link
7+
url: http://mademistakes.com

_includes/browser-upgrade.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!--[if lt IE 9]><div class="upgrade"><strong><a href="http://whatbrowser.org/">Your browser is quite old!</strong> Why not upgrade to a different browser to better enjoy this site?</a></div><![endif]-->

_includes/disqus_comments.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% if site.disqus_shortname %}
2+
<script type="text/javascript">
3+
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
4+
var disqus_shortname = '{{ site.disqus_shortname }}'; // required: replace example with your forum shortname
5+
6+
/* * * DON'T EDIT BELOW THIS LINE * * */
7+
(function() {
8+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
9+
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
10+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
11+
})();
12+
13+
/* * * DON'T EDIT BELOW THIS LINE * * */
14+
(function () {
15+
var s = document.createElement('script'); s.async = true;
16+
s.type = 'text/javascript';
17+
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
18+
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
19+
}());
20+
</script>
21+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
22+
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
23+
{% endif %}

_includes/feed-footer.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
&lt;p&gt;&lt;a href=&quot;{{ site.url }}{{ post.url }}&quot;&gt;{{ post.title | xml_escape }}&lt;/a&gt; was originally published by {{ site.owner.name }} at &lt;a href=&quot;{{ site.url }}&quot;&gt;{{ site.title }}&lt;/a&gt; on {{ post.date | date: "%B %d, %Y" }}.&lt;/p&gt;

_includes/footer.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span>&copy; {{ site.time | date: '%Y' }} {{ site.owner.name }}. Powered by <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> using the <a href="http://mademistakes.com/hpstr/" rel="notfollow">HPSTR Theme</a>.</span>

_includes/gallery

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% assign images = include.images | split:" " %}
2+
{% assign caption = include.caption %}
3+
{% assign cols = include.cols %}
4+
5+
{% case cols %}
6+
{% when 1 %}
7+
{% assign class = "" %}
8+
{% when 2 %}
9+
{% assign class = "half" %}
10+
{% when 3 %}
11+
{% assign class = "third" %}
12+
{% else %}
13+
{% assign class = "" %}
14+
{% endcase %}
15+
16+
<figure {% if class != "" %}class="{{ class }}"{% endif %}>
17+
{% for image in images %}
18+
<a href="{{ image }}"><img src="{{ image }}" alt=""></a>
19+
{% endfor %}
20+
<figcaption>{{ caption }}</figcaption>
21+
</figure>

_includes/head.html

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<meta charset="utf-8">
2+
<title>{% if page.title %}{{ page.title }} &#8211; {% endif %}{{ site.title }}</title>
3+
<meta name="description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
4+
{% if page.tags %}<meta name="keywords" content="{{ page.tags | join: ', ' }}">{% endif %}
5+
6+
{% if site.owner.twitter %}<!-- Twitter Cards -->
7+
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
8+
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}">
9+
{% else %}<meta name="twitter:card" content="summary">
10+
<meta name="twitter:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}">{% endif %}
11+
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
12+
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
13+
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">{% endif %}
14+
15+
<!-- Open Graph -->
16+
<meta property="og:locale" content="en_US">
17+
<meta property="og:type" content="article">
18+
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
19+
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
20+
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
21+
<meta property="og:site_name" content="{{ site.title }}">
22+
23+
{% if site.google_verify %}<meta name="google-site-verification" content="{{ site.google_verify }}">{% endif %}
24+
{% if site.bing_verify %}<meta name="msvalidate.01" content="{{ site.bing_verify }}">{% endif %}
25+
26+
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
27+
<link rel="canonical" href="{{ canonical }}">
28+
<link href="{{ site.url }}/feed.xml" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
29+
30+
<!-- http://t.co/dKP3o1e -->
31+
<meta name="HandheldFriendly" content="True">
32+
<meta name="MobileOptimized" content="320">
33+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
34+
35+
<!-- For all browsers -->
36+
<link rel="stylesheet" href="{{ site.url }}/assets/css/main.css">
37+
<!-- Webfonts -->
38+
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">
39+
40+
<meta http-equiv="cleartype" content="on">
41+
42+
<!-- Load Modernizr -->
43+
<script src="{{ site.url }}/assets/js/vendor/modernizr-2.6.2.custom.min.js"></script>
44+
45+
<!-- Icons -->
46+
<!-- 16x16 -->
47+
<link rel="shortcut icon" href="{{ site.url }}/favicon.ico">
48+
<!-- 32x32 -->
49+
<link rel="shortcut icon" href="{{ site.url }}/favicon.png">
50+
<!-- 57x57 (precomposed) for iPhone 3GS, pre-2011 iPod Touch and older Android devices -->
51+
<link rel="apple-touch-icon-precomposed" href="{{ site.url }}/images/apple-touch-icon-precomposed.png">
52+
<!-- 72x72 (precomposed) for 1st generation iPad, iPad 2 and iPad mini -->
53+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ site.url }}/images/apple-touch-icon-72x72-precomposed.png">
54+
<!-- 114x114 (precomposed) for iPhone 4, 4S, 5 and post-2011 iPod Touch -->
55+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ site.url }}/images/apple-touch-icon-114x114-precomposed.png">
56+
<!-- 144x144 (precomposed) for iPad 3rd and 4th generation -->
57+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.url }}/images/apple-touch-icon-144x144-precomposed.png">
58+
59+
{% if page.image.background or site.background %}
60+
{% capture background %}{% if page.image.background %}{{ page.image.background }}{% else %}{{ site.background }}{% endif %}{% endcapture %}
61+
{% unless background contains 'http://' or background contains 'https://' %}{% capture background %}{{ site.url }}/images/{{ background }}{% endcapture %}{% endunless %}
62+
<style type="text/css">body {background-image:url({{ background }});}</style>
63+
{% endif %}

0 commit comments

Comments
 (0)