summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidtsadler <davidtsadler@googlemail.com>2011-12-30 00:55:09 +0000
committerdavidtsadler <davidtsadler@googlemail.com>2011-12-30 00:55:09 +0000
commit1769e1cdcfe58339eb6ff7f13925090edaa8a4a8 (patch)
treee2692dd6f483f9e57d41a34183c71198772d6f93
parent4f363292ad67daa9f1b009ed6453567894157257 (diff)
Add archives page and ordinalize plugin.
-rw-r--r--_site_build/_includes/post_excerpt.html4
-rw-r--r--_site_build/_includes/sidebar.html1
-rw-r--r--_site_build/_layouts/post.html2
-rw-r--r--_site_build/_plugins/date.rb19
-rw-r--r--_site_build/about.html4
-rw-r--r--_site_build/archives.html26
-rw-r--r--_site_build/css/style.css50
7 files changed, 82 insertions, 24 deletions
diff --git a/_site_build/_includes/post_excerpt.html b/_site_build/_includes/post_excerpt.html
index 7edb5a0..a8ef58e 100644
--- a/_site_build/_includes/post_excerpt.html
+++ b/_site_build/_includes/post_excerpt.html
@@ -1,8 +1,8 @@
<article class="excerpt">
<header>
<h1>{{ post.title }}</h1>
- <time datetime="{{ post.date | date: '%Y-%m-%d' }}" pubdate>{{ post.date | date: '%A, %d %B, %Y' }}</time>
+ <time datetime="{{ post.date | date: '%Y-%m-%d' }}" pubdate>{{ post.date | date: '%A' }} {{ post.date | ordinalize }} {{ post.date | date: '%B, %Y' }}</time>
</header>
{{ post.content | text_excerpt }}
- <a href="{{ post.url }}" title="{{ post.title }}">Click to continue reading &raquo;</a></li>
+ <a href="{{ post.url }}" target="_self" title="{{ post.title }}">Click to continue reading &raquo;</a>
</article>
diff --git a/_site_build/_includes/sidebar.html b/_site_build/_includes/sidebar.html
index a8fa207..0789325 100644
--- a/_site_build/_includes/sidebar.html
+++ b/_site_build/_includes/sidebar.html
@@ -3,6 +3,7 @@
<h2>Links</h2>
<ul>
<li><a href="/" rel="home" target="_self" title="{{ site.title }}">Home</a></li>
+ <li><a href="/archives.html" target="_self" title="Archives">Archives</a></li>
<li><a href="/about.html" rel="author" target="_self" title="About {{ site.author }}">About</a></li>
</ul>
</nav>
diff --git a/_site_build/_layouts/post.html b/_site_build/_layouts/post.html
index 3d460eb..f37fc0d 100644
--- a/_site_build/_layouts/post.html
+++ b/_site_build/_layouts/post.html
@@ -4,7 +4,7 @@ layout: default
<article>
<header>
<h1>{{ page.title }}</h1>
- <time datetime="{{ page.date | date: '%Y-%m-%d' }}" pubdate>{{ page.date | date: '%A, %d %B, %Y' }}</time>
+ <time datetime="{{ page.date | date: '%Y-%m-%d' }}" pubdate>{{ page.date | date: '%A' }} {{ page.date | ordinalize }} {{ page.date | date: '%B, %Y' }}</time>
</header>
{{ content }}
<footer>
diff --git a/_site_build/_plugins/date.rb b/_site_build/_plugins/date.rb
new file mode 100644
index 0000000..f1a3c26
--- /dev/null
+++ b/_site_build/_plugins/date.rb
@@ -0,0 +1,19 @@
+module Jekyll
+ module DateFilter
+ def ordinalize(date)
+ day = date.day
+ if (11..13).include?(day % 100)
+ "#{day}th"
+ else
+ case day % 10
+ when 1; "#{day}st"
+ when 2; "#{day}nd"
+ when 3; "#{day}rd"
+ else "#{day}th"
+ end
+ end
+ end
+ end
+end
+
+Liquid::Template.register_filter(Jekyll::DateFilter)
diff --git a/_site_build/about.html b/_site_build/about.html
index 3d49872..91a6aee 100644
--- a/_site_build/about.html
+++ b/_site_build/about.html
@@ -2,4 +2,6 @@
layout: default
title: About
---
-<h2>about</h2>
+<section id="about">
+ <h1>About</h1>
+</section>
diff --git a/_site_build/archives.html b/_site_build/archives.html
new file mode 100644
index 0000000..38efebf
--- /dev/null
+++ b/_site_build/archives.html
@@ -0,0 +1,26 @@
+---
+layout: default
+title: Archives
+---
+<section id="archives">
+ <h1>Archives</h1>
+ {% for post in site.posts %}
+ {% unless post.next %}
+ <h2>{{ post.date | date: '%Y' }}</h2>
+ <ol>
+ {% else %}
+ {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
+ {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
+ {% if year != nyear %}
+ </ol>
+ <h2>{{ post.date | date: '%Y' }}</h2>
+ <ol>
+ {% endif %}
+ {% endunless %}
+ <li>
+ <time datetime="{{ post.date | date: '%Y-%m-%d' }}" pubdate>{{ post.date | date: '%b' }} {{ post.date | ordinalize }}</time> <a href="{{ post.url }}" target="_self" title="{{ post.title }}">{{ post.title }}</a>
+ </li>
+ {% endfor %}
+ </ol>
+</section>
+
diff --git a/_site_build/css/style.css b/_site_build/css/style.css
index f5e987e..98b887e 100644
--- a/_site_build/css/style.css
+++ b/_site_build/css/style.css
@@ -159,6 +159,14 @@ h1, h2, h3, h4, h5, h6 {
padding: 0;
}
+article h1, section#about h1, section#archives h1 {
+ font-size: 1.461538462em; /* 19 / 13 */
+}
+
+article h2, section#about h2, section#archives h2 {
+ font-size: 1.1538461538em; /* 15 / 13 */
+}
+
#header {
margin-bottom: 3em; /* 39 / 13 */
border-bottom: 1px solid #CCCCCC;
@@ -198,33 +206,22 @@ h1, h2, h3, h4, h5, h6 {
text-transform: lowercase;
}
-li.prev-article{
+li.prev-article a, li.next-article a {
+ display: block;
+}
+
+li.prev-article {
float: left;
width: 50%;
}
-li.next-article{
+li.next-article {
float: right;
text-align: right;
width: 50%;
}
-li.prev-article a, li.next-article a {
- display: block;
-}
-
-article h1
-{
- font-size: 1.461538462em; /* 19 / 13 */
-}
-
-article h2
-{
- font-size: 1.1538461538em; /* 15 / 13 */
-}
-
-article footer nav ul:after
-{
+article footer nav ul:after {
clear: both;
content: ".";
display: block;
@@ -233,11 +230,24 @@ article footer nav ul:after
visibility: hidden;
}
-article.excerpt
-{
+article.excerpt {
margin-bottom: 2em;
}
+section#archives h1 {
+ margin-bottom: 1em;
+}
+
+section#archives ol {
+ list-style-type: disc;
+}
+
+section#archives time {
+ display: inline-block;
+ width: 4em;
+}
+
+
/* ==|== non-semantic helper classes ======================================== */
.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; }
.ir br { display: none; }