Commit af872c08 authored by Connor Shea's avatar Connor Shea 🏄

Post tags now have pages!

parent 8b97da95
rails:
slug: rails
name: Rails
i18n:
slug: i18n
name: Internationalization (18n)
react:
slug: react
name: React
css:
slug: css
name: CSS
scss:
slug: scss
name: SCSS
\ No newline at end of file
---
layout: default
---
{% assign post = page %}
{% if post.tags.size > 0 %}
{% for post_tag in post.tags %}
{% assign tag = site.data.tags[post_tag] %}
{% assign data_tag_slug = tag[0] %}
{% if tag %}
{% capture tags_content_temp %}{{ tags_content }}
<span><a href="/blog/tag/{{ tag.slug }}/">{{ tag.name }}</a></span>
{% endcapture %}
{% assign tags_content = tags_content_temp %}
{% endif %}
{% endfor %}
{% endif %}
<div class="post">
<header class="post-header">
<p class="post-backlink"><a href="{{ '/blog' | prepend: site.baseurl }}">Blog</a></p>
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-meta">{{ page.date | date: "%B %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
<p class="post-tags">
{{ tags_content }}
</p>
</header>
<article class="post-content">
......
---
layout: default
---
<div class="page">
<header class="page-header">
<h1 class="page-title">{{ page.tag }}</h1>
</header>
<ul class="post-list">
{% if site.tags[page.tag] %}
{% for post in site.tags[page.tag] %}
<li>
<span class="post-meta">{{ post.date | date: "%B %-d, %Y" }}</span>
<h2><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
{{ post.excerpt }}
</li>
{% endfor %}
{% else %}
<p>There are no posts for this tag.</p>
{% endif %}
</ul>
</div>
......@@ -159,6 +159,30 @@
margin-bottom: 8px;
}
.post-tags {
font-size: $small-font-size;
color: #aaaab2;
font-family: $slab-serif;
margin: 8px 0 12px;
span {
border: 1px solid #c4c4c4;
border-radius: 2px;
margin-right: 5px;
cursor: pointer;
display: inline-block;
a {
display: block;
padding: 4px 10px;
&:hover {
text-decoration: none;
}
}
}
}
.post-backlink {
border-bottom: 1px solid $grey-color;
display: inline-block;
......
......@@ -9,9 +9,8 @@ permalink: /blog/
<li>
<span class="post-meta">{{ post.date | date: "%B %-d, %Y" }}</span>
<h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h2>
<h2><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
{{ post.excerpt }}
</li>
{% endfor %}
......
---
layout: tag
tag: css
permalink: /blog/tag/css/
---
\ No newline at end of file
---
layout: tag
tag: i18n
permalink: /blog/tag/i18n/
---
\ No newline at end of file
---
layout: tag
tag: rails
permalink: /blog/tag/rails/
---
\ No newline at end of file
---
layout: tag
tag: react
permalink: /blog/tag/react/
---
\ No newline at end of file
---
layout: tag
tag: scss
permalink: /blog/tag/scss/
---
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment