Skip to content

Commit d3267ad

Browse files
committed
Add templates, styles, and scripts
1 parent 1f13a0f commit d3267ad

39 files changed

+1587
-0
lines changed

_config.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Blog Settings
3+
#
4+
name: Phil Haack
5+
description: You've been Haacked and you like it
6+
url: http://haacked.com
7+
title: You've Been Haacked
8+
subtitle: ...and you like it
9+
gravatar_url: https://2.gravatar.com/avatar/cdf546b601bf29a7eb4ca777544d11cd
10+
subscribe_rss: http://feeds.haacked.com/haacked
11+
12+
# Github repositories
13+
github_user: haacked
14+
github_repo_url: https://github.com/Haacked/haacked.com/
15+
16+
# Twitter
17+
twitter_user: haacked
18+
twitter_tweet_button: true
19+
20+
# Disqus Comments
21+
disqus_short_name: haacked
22+
disqus_show_comment_count: true
23+
24+
# Google Analytics
25+
google_analytics_tracking_id: UA-177588-1
26+
27+
28+
#
29+
# Jekyll Settings
30+
#
31+
markdown: rdiscount
32+
pygments: true
33+
permalink: /archive/:year/:month/:day/:title/
34+
rdiscount:
35+
extensions: [smart]
36+
paginate: 5
37+
paginate_path: "page/:num"
38+
category_dir: categories

_includes/archive_post.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% capture date %}{{ post.date }}{% endcapture %}
2+
{% capture this_year %}{{ date | date: "%Y" }}{% endcapture %}
3+
{% unless year == this_year %}
4+
{% assign year = this_year %}
5+
{% unless forloop.first %}
6+
</ul>
7+
{% endunless %}
8+
<h2 class="year">{{ date | date: "%Y" }}</h2>
9+
<ul>
10+
{% endunless %}
11+
<li>
12+
<h3 class="title"><a href="{{ post.url }}">{{post.title}}</a></h3>
13+
<div class="meta">
14+
<span class="date"><time datetime="{{ date | datetime | date_to_xmlschema }}" itemprop="datePublished">{{ date | date: "%b %e" }}</time></span>
15+
{% if post.categories.length > 0 %}
16+
<span class="tags">{% include post/categories.html %}</span>
17+
{% endif %}
18+
{% if site.disqus_short_name and post.comments == true and site.disqus_show_comment_count == true %}
19+
{% include post/comments_link.html %}
20+
{% endif %}
21+
<span class="edit">{% include post/edit.html %}</span>
22+
</div>
23+
</li>

_includes/article.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if index %}
2+
<h1 class="title" itemprop="name"><a href="{{ post.url }}" itemprop="url">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
3+
{% include post/meta.html %}
4+
<div class="entry-content" itemprop="articleBody">
5+
{{ content | excerpt }}
6+
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
7+
{% if excerpted == 'true' %}<a href="{{ post.url }}" class="more-link">{{ site.excerpt_link }}</a>{% endif %}
8+
</div>
9+
{% else %}
10+
<h1 class="title" itemprop="name">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
11+
{% include post/meta.html %}
12+
<div class="entry-content" itemprop="articleBody">{{ content }}</div>
13+
{% endif %}

_includes/banner.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% if site.twitter_user and site.twitter_tweet_count > 0 %}
2+
<div id="banner" class="inner">
3+
<div class="container">
4+
<ul class="feed"></ul>
5+
</div>
6+
<small><a href="http://twitter.com/{{ site.twitter_user }}">{{ site.twitter_user }}</a> @ <a href="http://twitter.com">Twitter</a></small>
7+
<div class="loading">Loading...</div>
8+
</div>
9+
<script src="{{ root_url }}/javascripts/twitter.js"></script>
10+
<script type="text/javascript">
11+
(function($){
12+
$('#banner').getTwitterFeed('{{ site.twitter_user }}', {{ site.twitter_tweet_count }}, {{ site.twitter_show_replies }});
13+
})(jQuery);
14+
</script>
15+
{% endif %}

_includes/custom/category_feed.xml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: nil
3+
---
4+
<?xml version="1.0" encoding="utf-8"?>
5+
<feed xmlns="http://www.w3.org/2005/Atom">
6+
7+
<title><![CDATA[{% if site.titlecase %}{{ page.title | titlecase | cdata_escape }}{% else %}{{ page.title | cdata_escape }}{% endif %} | {{ site.title | cdata_escape }}]]></title>
8+
<link href="{{ site.url }}/{{ page.feed_url }}" rel="self"/>
9+
<link href="{{ site.url }}/"/>
10+
<updated>{{ site.time | date_to_xmlschema }}</updated>
11+
<id>{{ site.url }}/</id>
12+
<author>
13+
<name><![CDATA[{{ site.author | strip_html }}]]></name>
14+
{% if site.email %}<email><![CDATA[{{ site.email }}]]></email>{% endif %}
15+
</author>
16+
<generator uri="http://octopress.org/">Octopress</generator>
17+
18+
{% for post in site.categories[page.category] limit: 5 %}
19+
<entry>
20+
<title type="html"><![CDATA[{% if site.titlecase %}{{ post.title | titlecase | cdata_escape }}{% else %}{{ post.title | cdata_escape }}{% endif %}]]></title>
21+
<link href="{{ site.url }}{{ post.url }}"/>
22+
<updated>{{ post.date | date_to_xmlschema }}</updated>
23+
<id>{{ site.url }}{{ post.id }}</id>
24+
<content type="html"><![CDATA[{{ post.content | expand_urls: site.url | markdownify | cdata_escape }}]]></content>
25+
</entry>
26+
{% endfor %}
27+
</feed>

_includes/disqus.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %}
2+
{% if site.disqus_short_name and page.comments != false %}
3+
<script type="text/javascript">
4+
var disqus_shortname = '{{ site.disqus_short_name }}';
5+
{% if page.comments == true %}
6+
{% comment %} `page.comments` can be only be set to true on pages/posts, so we embed the comments here. {% endcomment %}
7+
// var disqus_developer = 1;
8+
var disqus_identifier = '{% if page.disqus_identifier %}{{ page.disqus_identifier}}{% else %}{{ site.url }}{{ page.url }}{% endif %}';
9+
var disqus_url = '{{ site.url }}{{ page.url }}';
10+
var disqus_script = 'embed.js';
11+
{% endif %}
12+
(function () {
13+
{% if page.comments == true %}
14+
var embedScript = document.createElement('script');
15+
embedScript.type = 'text/javascript';
16+
embedScript.async = true;
17+
embedScript.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
18+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(embedScript);
19+
{% endif %}
20+
var countScript = document.createElement('script');
21+
countScript.type = 'text/javascript';
22+
countScript.async = true;
23+
countScript.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
24+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(countScript);
25+
}());
26+
</script>
27+
{% endif %}

_includes/footer.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<p>
2+
Copyright &copy; {{ site.time | date: "%Y" }} - {{ site.author }} Blog content licensed under the Creative Commons <a href="http://creativecommons.org/licenses/by/2.5/">CC BY 2.5</a> | <a href="/privacy">privacy</a> | <a href="/articles/blogtegrity">blogtegrity</a>
3+
</p>
4+
<img id="feedburner-count" src="http://feedproxy.google.com/~fc/haacked?bg=FFFFFF&amp;fg=999999&amp;anim=0" alt="Reader count" />
5+
6+
{% include disqus.html %}
7+
{% include twitter_sharing.html %}

_includes/google_analytics.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if site.google_analytics_tracking_id %}
2+
<script type="text/javascript">
3+
var _gaq = _gaq || [];
4+
_gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']);
5+
_gaq.push(['_trackPageview']);
6+
7+
(function() {
8+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
9+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
10+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
11+
})();
12+
</script>
13+
{% endif %}

_includes/head.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE HTML>
2+
{% if site.lang %}
3+
<html lang="{{ site.lang }}">
4+
{% else %}
5+
<html>
6+
{% endif %}
7+
<head>
8+
<meta charset="utf-8">
9+
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
10+
<meta name="author" content="{{ site.author }}">
11+
12+
{% capture description %}
13+
{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}
14+
{% endcapture %}
15+
<meta name="description" content="{{ description }}">
16+
{% if page.keywords %}<meta name="keywords" content="{{ page.keywords }}">{% endif %}
17+
18+
<!-- http://t.co/dKP3o1e -->
19+
<meta name="HandheldFriendly" content="True">
20+
<meta name="MobileOptimized" content="320">
21+
<meta name="viewport" content="width=device-width, initial-scale=1">
22+
23+
<link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml">
24+
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
25+
<link rel="canonical" href="{{ canonical }}">
26+
<link href="/favicon.png" rel="shortcut icon">
27+
<link href="/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
28+
<link href="/css/font-awesome.min.css" media="screen, projection" rel="stylesheet" type="text/css">
29+
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
30+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700' rel='stylesheet' type='text/css'>
31+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
32+
<script src="/js/slash.js"></script>
33+
34+
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
35+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800' rel='stylesheet' type='text/css'>
36+
37+
{% include google_analytics.html %}
38+
</head>

_includes/header.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<div class="profilepic">
2+
{% if site.gravatar_url %}
3+
<img src="{{ site.gravatar_url }}?s=160" alt="Profile Picture" style="width: 160px;" />
4+
{% endif %}
5+
</div>
6+
<hgroup>
7+
<h1><a href="/">{{ site.title }}</a></h1>
8+
{% if site.subtitle %}
9+
<h2>{{ site.subtitle }}</h2>
10+
{% endif %}
11+
</hgroup>
12+
<nav id="main-nav">{% include navigation.html %}</nav>
13+
<nav id="sub-nav">
14+
<div class="social">
15+
{% if site.email %}
16+
<a class="email" href="mailto:{{ site.email }}" title="Email">Email</a>
17+
{% endif %}
18+
{% if site.twitter_user %}
19+
<a class="twitter" href="http://twitter.com/{{ site.twitter_user }}" title="Twitter">Twitter</a>
20+
{% endif %}
21+
{% if site.github_user %}
22+
<a class="github" href="https://github.com/{{ site.github_user }}" title="GitHub">GitHub</a>
23+
{% endif %}
24+
{% if site.subscribe_rss %}
25+
<a class="rss" href="{{ site.subscribe_rss }}" title="RSS">RSS</a>
26+
{% endif %}
27+
</div>
28+
</nav>

_includes/navigation.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<ul class="main-navigation">
2+
<li><a href="/about/">about</a></li>
3+
<li><a href="/archive">archives</a></li>
4+
<li><a href="https://github.com/Haacked/feedback">contact</a></li>
5+
</ul>
6+
7+
{% if site.description %}
8+
<section class="aboutme">
9+
<p>
10+
{{ site.description }}
11+
</p>
12+
</section>
13+
{% endif %}

_includes/post/categories.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ page.categories | join: ', ' }}{{ post.categories | join: ', ' }}

_includes/post/comments_link.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% if post.disqus_identifier %}
2+
{% assign disqus_identifier = post.disqus_identifier %}
3+
{% else %}
4+
{% assign disqus_identifier = page.disqus_identifier %}
5+
{% endif %}
6+
7+
<span class="comments"><a href="{{ post.url }}#disqus_thread"{% if disqus_identifier %} data-disqus-identifier="{{ disqus_identifier }}"{% endif %}>comments</a></span>

_includes/post/date.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %}
2+
{% capture has_date %}{{ date | size }}{% endcapture %}
3+
4+
{% if has_date != '0' %}
5+
{% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" {% if updated %}data-updated="true"{% endif %} itemprop="datePublished">{{ date | date: "%B %e, %Y" }}</time>{% endcapture %}
6+
{% endif %}
7+

_includes/post/disqus_thread.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

_includes/post/edit.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% if post.url %}
2+
{% assign path = post.path %}
3+
{% else %}
4+
{% assign path = page.path %}
5+
{% endif %}
6+
7+
<a href="{{ site.github_repo_url }}edit/master/source/_posts/{{ path }}">edit</a>

_includes/post/meta.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="meta">
2+
<span class="date">{% include post/date.html %}{{ time }}</span>
3+
<span class="tags">{% include post/categories.html %}</span>
4+
{% if site.disqus_short_name and site.disqus_show_comment_count == true %}
5+
{% include post/comments_link.html %}
6+
{% endif %}
7+
<span class="edit">{% include post/edit.html %}</span>
8+
</div>

_includes/post/sharing.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="share">
2+
<div class="addthis_toolbox addthis_default_style ">
3+
{% if site.twitter_tweet_button %}
4+
<a class="addthis_button_tweet"></a>
5+
{% endif %}
6+
<a class="addthis_counter addthis_pill_style"></a>
7+
</div>
8+
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid={{ site.addthis_profile_id }}"></script>
9+
</div>

_includes/twitter_sharing.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% if site.twitter_follow_button or site.twitter_tweet_button %}
2+
<script type="text/javascript">
3+
(function(){
4+
var twitterWidgets = document.createElement('script');
5+
twitterWidgets.type = 'text/javascript';
6+
twitterWidgets.async = true;
7+
twitterWidgets.src = '//platform.twitter.com/widgets.js';
8+
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
9+
})();
10+
</script>
11+
{% endif %}

_layouts/category_index.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: default
3+
---
4+
5+
{% for post in site.categories[page.category] %}
6+
{% include archive_post.html %}
7+
{% endfor %}

_layouts/default.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{% include head.html %}
2+
3+
<body>
4+
<div class="container">
5+
<div class="left-col">
6+
<div class="intrude-less">
7+
<header id="header" class="inner">{% include header.html %}</header>
8+
</div>
9+
</div>
10+
<div class="mid-col">
11+
<div class="mid-col-container">
12+
<div id="content" class="inner">{{ content }}</div>
13+
</div>
14+
<footer id="footer" class="inner">{% include footer.html %}</footer>
15+
</div>
16+
</div>
17+
18+
19+
<!-- CodeProject AD -->
20+
<script>
21+
function _dmBootstrap(file) {
22+
var _dma = document.createElement('script');
23+
_dma.type = 'text/javascript';
24+
_dma.async = true;
25+
_dma.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + file;
26+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(_dma);
27+
}
28+
function _dmFollowup(file) { if (typeof DMAds === 'undefined') _dmBootstrap('cdn2.DeveloperMedia.com/a.min.js');}
29+
(function () { _dmBootstrap('cdn1.DeveloperMedia.com/a.min.js'); setTimeout(_dmFollowup, 2000);})();
30+
</script>
31+
</body>
32+
</html>

_layouts/page.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
layout: default
3+
---
4+
5+
<article class="page">
6+
{% if page.title %}
7+
<h1 class="title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
8+
{% endif %}
9+
<div class="entry-content">{{ content }}</div>
10+
</article>
11+
{% if site.disqus_short_name and page.comments == true %}
12+
<section id="comment">
13+
<h1 class="title">Comments</h1>
14+
<div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div>
15+
</section>
16+
{% endif %}

0 commit comments

Comments
 (0)