Permalink
Browse files

Add tags to post (issue #39)

  • Loading branch information...
SarahAlhumud committed Aug 5, 2017
1 parent 426fd90 commit 3f9cc0f9625f5e585dcde0dd1b13f3ec50d87091
View
@@ -120,6 +120,15 @@ nav h1, nav h2 {
font-size: 13px;
}
#tags {
margin-top: 80px;
margin-bottom: 50px;
font-size: 13px;
padding-top: 15px ;
border-top: dotted #ddd;
border-width: 1px 0;
}
#post pre {
border: 1px solid #ddd;
background-color: #eef;
View
@@ -17,4 +17,8 @@ <h2>I'm <a href="/">{{ site.data.theme.name }}</a>.</h2>
<div id="social">
{% include social.html %}
</div>
<div id="tags">
{% include tags.html %}
</div>
</nav>
View
@@ -0,0 +1,15 @@
<span >
{% assign sorted_tags = site.tags | sort %}
{% for tag in sorted_tags %}
<a href="{{ '/tag/' | append:tag[0] }}.html" rel="tag">
{{tag[0]}}
{% if forloop.last %}
.
{% else %}
,
{% endif %}
</a>
{% endfor %}
</span>
View
@@ -1,9 +1,9 @@
---
---
layout: default
---
<p class="meta">
{{ page.date | date: "%B %d, %Y" }}
{{ page.date | date: "%B %d, %Y" }}
<a href="/">
<i class="home fa fa-home"></i>
</a>
@@ -24,4 +24,19 @@ <h3>Related Posts</h3>
</li>
{% endfor %}
</ul>
<h3>Tags :</h3>
<span>
{% for tag in page.tags %}
<a href="{{ '/tag/' | append:tag }}.html" rel="tag">
{{ tag }}
{% if forloop.last %}
.
{% else %}
,
{% endif %}
</a>
{% unless forloop.last %}{% endunless %}{% endfor %}
</span>
</div>
View
@@ -0,0 +1,20 @@
---
layout: default
---
{% capture tag %}{{ page.title | slugify }}{% endcapture %}
<div id="home">
<h2><i class="fa fa-bookmark"></i> {{ tag | capitalize }} Posts </h2>
<ul id="blog-posts" class="posts">
{% for post in site.posts %}
{% if post.tags contains tag %}
<li><span>{{ post.date | date_to_string }} &raquo;</span>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
@@ -1,6 +1,7 @@
---
layout: post
title: Another sample
tags: [jekyll, syntax]
categories:
- blog
---
@@ -1,6 +1,7 @@
---
layout: post
title: Sample post
tags: [code, jekyll]
categories:
- blog
---
View
@@ -0,0 +1,4 @@
---
layout: tag
title: code
---
View
@@ -0,0 +1,4 @@
---
layout: tag
title: jekyll
---
View
@@ -0,0 +1,4 @@
---
layout: tag
title: syntax
---

0 comments on commit 3f9cc0f

Please sign in to comment.