Browse Source

Try to add tags

http://www.minddust.com/post/tags-and-categories-on-github-pages/ except
step 6 that I don't understand.
tags/2016-05-10
Mikaela Suomalainen 4 years ago
parent
commit
1a0bc9b25d
7 changed files with 38 additions and 4 deletions
  1. +6
    -0
      _data/tags.yml
  2. +11
    -0
      _layouts/blog_by_tag.html
  3. +17
    -0
      _layouts/post.html
  4. +1
    -1
      _posts/2014-12-30-test.md
  5. +1
    -1
      _posts/2014-12-30-testi.md
  6. +1
    -1
      _posts/2015-01-10-channels-hostmask-groups-a-basic-howto.md
  7. +1
    -1
      _posts/2015-01-24-getting_help_with_channel_issues.md

+ 6
- 0
_data/tags.yml View File

@@ -0,0 +1,6 @@
- slug: finnish
name: in Finnish
- slug: english
name: in English
- slug: irc
name: IRC

+ 11
- 0
_layouts/blog_by_tag.html View File

@@ -0,0 +1,11 @@
<h1>Articles by tag :{{ page.tag }}</h1>
<div>
{% if site.tags[page.tag] %}
{% for post in site.tags[page.tag] %}
<a href="{{ post.url }}/">{{ post.title }}</a>
{% endfor %}
{% else %}
<p>There are no posts for this tag.</p>
{% endif %}
</div>


+ 17
- 0
_layouts/post.html View File

@@ -1,6 +1,22 @@
---
layout: default
---
{% if post.tags.size > 0 %}
{% capture tags_content %}Posted with {% if post.tags.size == 1 %}<i class="fa fa-tag"></i>{% else %}<i class="fa fa-tags"></i>{% endif %}: {% endcapture %}
{% for post_tag in post.tags %}
{% for data_tag in site.data.tags %}
{% if data_tag.slug == post_tag %}
{% assign tag = data_tag %}
{% endif %}
{% endfor %}
{% if tag %}
{% capture tags_content_temp %}{{ tags_content }}<a href="/blog/tag/{{ tag.slug }}/">{{ tag.name }}</a>{% if forloop.last == false %}, {% endif %}{% endcapture %}
{% assign tags_content = tags_content_temp %}
{% endif %}
{% endfor %}
{% else %}
{% assign tags_content = '' %}
{% endif %}
<div class="post">

<header class="post-header">
@@ -10,6 +26,7 @@ layout: default

<article class="post-content">
{{ content }}
<p id="post-meta">{{ tags_content }}</p>
</article>

</div>

+ 1
- 1
_posts/2014-12-30-test.md View File

@@ -2,7 +2,7 @@
layout: post
title: Testing...
category: [english]
tags: [test, english]
tags: [english]
---

It seems that I started trying the blog feature of Jekyll too.

+ 1
- 1
_posts/2014-12-30-testi.md View File

@@ -2,7 +2,7 @@
layout: post
title: Kokeilua...
category: [finnish]
tags: [testi, finnish]
tags: [finnish]
---

Vaikuttaa siltä, että aloitin myös Jekyllin bloggaustoiminnon kokeilun.

+ 1
- 1
_posts/2015-01-10-channels-hostmask-groups-a-basic-howto.md View File

@@ -2,7 +2,7 @@
layout: post
title: "Channels & Hostmask groups: A basic Howto"
category: [english]
tags: [oper, irc, groupserv, hostserv]
tags: [irc, english]
---

@Annwenn got me opering at her network after long pause with my opering.

+ 1
- 1
_posts/2015-01-24-getting_help_with_channel_issues.md View File

@@ -2,7 +2,7 @@
layout: post
title: "Getting help from network operators with channel issues when ops are away"
category: [english]
tags: [oper, irc, groupserv, hostserv]
tags: [irc, english]
---

In case you wish network operators to help you when your channel operators

Loading…
Cancel
Save