Skip to content

Commit

Permalink
Style: use <time> and move 'more' link up
Browse files Browse the repository at this point in the history
* Use <time> wherever we show a date
* Add some elements and css to move the 'more' link closer to the
  summary.
  • Loading branch information
danielbeardsley committed Mar 12, 2013
1 parent 4d4d3c4 commit 7294b2e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
4 changes: 3 additions & 1 deletion _includes/post_header.html
Expand Up @@ -2,7 +2,9 @@ <h1>
<a href="{{ page.url }}">{{ page.title }}</a>
</h1>
<div class="date">
{{ page.date | date: "%Y-%m-%d" }}
<time datetime="{{ page.date | date: "%Y-%m-%d" }}">
{{ page.date | date: "%Y-%m-%d" }}
</time>
{% if page.author %}
<small>-
{% if page.author_url %}
Expand Down
27 changes: 15 additions & 12 deletions index.html
Expand Up @@ -4,19 +4,22 @@

{% for page in paginator.posts %}
{% unless page.draft %}
<div class="date">
{{ page.date | date: "%Y-%m-%d" }}
<div class='short-post'>
<time datetime="{{ page.date | date: "%Y-%m-%d" }}">
{{ page.date | date: "%Y-%m-%d" }}
</time>
<h2>
<a href="{{ page.url }}">{{ page.title }}</a>
</h2>
<div class='summary'>
{% if page.summary %}
{{ page.summary | markdownify }}
{% else %}
{{ page.content | truncatewords: 130 }}
{% endif %}
<a class='more' href="{{ page.url }}">more</a>
</div>
</div>
<h2>
<a href="{{ page.url }}">{{ page.title }}</a>
</h2>
{% if page.summary %}
{{ page.summary | markdownify }}
{% else %}
{{ page.content | truncatewords: 130 }}
{% endif %}
<a href="{{ page.url }}">more</a>
<br /><br />
{% endunless %}
{% endfor %}

Expand Down
11 changes: 11 additions & 0 deletions stylesheets/styles.css
Expand Up @@ -269,3 +269,14 @@ footer {
border-radius: 25px;
border: 2px solid #eee;
}

/* Spacing between posts on index page. */
.short-post > .summary {
margin-bottom:2em;
}

/* reduce spacing between summary and 'more' link */
.summary > p {
margin-bottom:0.2em;
}

0 comments on commit 7294b2e

Please sign in to comment.