Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Blog sidebar #77

Merged
merged 4 commits into from
May 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions assets/timber.scss.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#Tag List
#Breadcrumbs
#Product Page
#Blogs and Comments
#Notes and Form Feedback
#Cart Page
#Demo Styles - for empty store state
Expand Down Expand Up @@ -1548,6 +1549,31 @@ a.btn-secondary {
}
}

// ==============================================================================
// #Blogs and Comments
// ==============================================================================
.template-article {
.article-header {
margin-bottom: 0;

& + .text-light {
display: block;
margin-bottom: $gutter;
}
}
}

// Comments
.comment-content {
margin-bottom: -$gutter/2;
}

.comment-author {
font-size: 14px;
font-style: italic;
margin-bottom: $gutter;
}


// ==============================================================================
// #Notes and Form Feedback
Expand Down
27 changes: 27 additions & 0 deletions snippets/blog-sidebar.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% comment %}
Recent blog posts
{% endcomment %}
<h4>Recent Articles</h4>
{% for article in blog.articles limit:6 %}
<p>
<a href="{{ article.url }}">{{ article.title }}</a>
<br>
<time pubdate datetime="{{ article.published_at | date: '%Y-%m-%d' }}">
<em class="text-light">{{ article.published_at | date: '%b %d, %Y' }}</em>
</time>
</p>
{% endfor %}

{% comment %}
Blog tags
{% endcomment %}
{% if blog.tags.size > 0 %}
<h4>Categories</h4>
<ul>
{% for tag in blog.tags %}
<li>
<a href="{{ tag.url }}">{{ tag.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
19 changes: 10 additions & 9 deletions snippets/comment.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

{% endcomment %}

<h3 class="comment-author">
{{ comment.author }} says...
</h3>

<h5 class="comment-date">
On {{ comment.created_at | date: "%B %d, %Y" }}
</h5>

<div class="comment-content">
{{ comment.content }}
</div>
</div>

<p class="comment-author text-light">
<strong>{{ comment.author }}</strong> on
<strong>
<time datetime="{{ comment.created_at | date: '%Y-%m-%d' }}">
{{ comment.created_at | date: '%b %d, %Y' }}
</time>
</strong>
</p>
33 changes: 23 additions & 10 deletions templates/article.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@
{% assign number_of_comments = article.comments_count | plus: 1 %}
{% endif %}

<div class="grid">
{% include 'breadcrumb' %}

<div class="grid-item large--two-thirds push--large--one-sixth">
<div class="grid">

{% include 'breadcrumb' %}
<div class="grid-item large--three-quarters">

<header class="page-header">
<time pubdate datetime="{{ article.published_at | date: '%Y-%m-%d' }}">
{{ article.published_at | date: '%b %d, %Y' }}
</time>
<h1>{{ article.title }}</h1>
<h1 class="article-header">{{ article.title }}</h1>
<em class="text-light">
Posted by <strong>{{ article.author }}</strong> on
<strong>
<time pubdate datetime="{{ article.published_at | date: '%Y-%m-%d' }}">
{{ article.published_at | date: '%b %d, %Y' }}
</time>
</strong>
</em>
</header>

<div class="rte">
Expand Down Expand Up @@ -85,8 +90,6 @@
</p>
{% endif %}



{% if blog.comments_enabled? %}

<hr>
Expand Down Expand Up @@ -114,7 +117,9 @@

{% if number_of_comments > 0 %}
<ul>
{% comment %}If a comment was just submitted with no blank field, let's show it.{% endcomment %}
{% comment %}
If a comment was just submitted with no blank field, show it.
{% endcomment %}
{% if comment and comment.created_at %}
<li id="{{ comment.id }}" class="comment first{% if article.comments_count == 0 %} last{% endif %}">

Expand Down Expand Up @@ -179,6 +184,10 @@

</div>

{% if blog.moderated? %}
<p class="text-light"><em><strong>Please note:</strong> comments must be approved before they are published</em></p>
{% endif %}

<input type="submit" class="btn" value="Post Comment">

{% if form.errors %}
Expand All @@ -202,4 +211,8 @@
{% endif %}

</div>

<div class="grid-item large--one-quarter">
{% include 'blog-sidebar' %}
</div>
</div>
10 changes: 8 additions & 2 deletions templates/blog.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@

{% paginate blog.articles by 5 %}

{% include 'breadcrumb' %}

{% comment %}
This template is also used for listing out articles of a specific tag.
You can change layouts or styles by checking if current_tags is true.
{% endcomment %}

<div class="grid">

<div class="grid-item large--two-thirds push--large--one-sixth">
<div class="grid-item large--three-quarters">
<header class="page-header">

{% if current_tags %}
Expand Down Expand Up @@ -83,7 +85,11 @@
{% include 'pagination-custom' %}
</div>
{% endif %}


</div>

<div class="grid-item large--one-quarter">
{% include 'blog-sidebar' %}
</div>
</div>

Expand Down