Skip to content

Commit

Permalink
added tags support
Browse files Browse the repository at this point in the history
  • Loading branch information
wowthemesnet committed Mar 20, 2019
1 parent e77bb6c commit fc4c7d8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
19 changes: 16 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ <h1 class="posttitle">{{ page.title }}</h1>
</p>

<!-- Post Categories -->
<div class="after-post-tags">
<ul class="tags">
<div class="after-post-cats">
<ul class="tags mb-4">
{% assign sortedCategories = page.categories | sort %}
{% for category in sortedCategories %}
<li>
Expand All @@ -77,7 +77,20 @@ <h1 class="posttitle">{{ page.title }}</h1>
{% endfor %}
</ul>
</div>
<!-- End Categories -->
<!-- End Categories -->

<!-- Post Tags -->
<div class="after-post-tags">
<ul class="tags">
{% assign sortedTags = page.tags | sort %}
{% for tag in sortedTags %}
<li>
<a class="smoothscroll" href="{{site.baseurl}}/tags.html#{{ tag | replace: " ","-" }}">#{{ tag }}</a>
</li>
{% endfor %}
</ul>
</div>
<!-- End Tags -->

<!-- Prev/Next -->
<div class="row PageNavigation d-flex justify-content-between font-weight-bold">
Expand Down
23 changes: 23 additions & 0 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Tags"
layout: default
permalink: "/tags.html"
---

<div class="row listrecent">
{% for tag in site.tags %}
<div class="section-title col-md-12 mt-4">
<h2 id="{{ tag[0] | replace: " ","-" }}">Tag <span class="text-capitalize">{{ tag[0] }}</span></h2>
</div>
{% assign pages_list = tag[1] %}
{% for post in pages_list %}
{% if post.title != null %}
{% if group == null or group == post.group %}
{% include postbox.html %}
{% endif %}
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
{% endfor %}
</div>
5 changes: 5 additions & 0 deletions _pages/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: tags
title: Tags
permalink: /tags
---
1 change: 1 addition & 0 deletions _posts/2018-01-11-customer-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: post
title: "Inception Movie"
author: john
categories: [ Jekyll, tutorial ]
tags: [red, yellow]
image: assets/images/11.jpg
description: "My review of Inception movie. Acting, plot and something else in this short description."
featured: true
Expand Down

0 comments on commit fc4c7d8

Please sign in to comment.