Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (64 sloc) 1.83 KB
---
layout: jumbotron-container
title: Resource Tracks
permalink: /resources/tracks/
css-package: resources-blog
---
{% comment %}
=======================
The following part extracts all the tags from your posts and sort tags, so that you do not need to manually collect your tags to a place.
=======================
{% endcomment %}
{% assign rawtags = "" %}
{% for post in site.posts %}
{% assign post-tracks = post.session_track | split: "," %}
{% assign ttags = post-tracks | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:ttags %}
{% endfor %}
{% assign rawtags = rawtags | split:'|' | sort %}
{% comment %}
=======================
The following part removes dulpicated tags and invalid tags like blank tag.
=======================
{% endcomment %}
{% assign tags = "" %}
{% for tag in rawtags %}
{% if tag != "" %}
{% if tags == "" %}
{% assign tags = tag | split:'|' %}
{% endif %}
{% unless tags contains tag %}
{% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %}
{% endunless %}
{% endif %}
{% endfor %}
{% comment %}
=======================
The purpose of this snippet is to list all the tags you have in your site.
=======================
{% endcomment %}
{% for tag in tags %}
<a class="btn btn-blog btn-xs post_tag" href="#{{ tag | slugify }}"> {{ tag }} </a>
{% endfor %}
{% comment %}
=======================
The purpose of this snippet is to list all your posts posted with a certain tag.
=======================
{% endcomment %}
{% for tag in tags %}
<h2 id="{{ tag | slugify }}">{{ tag }}</h2>
<ul>
{% for post in site.posts %}
{% if post.session_track contains tag %}
<li>
<p>
<a href="{{ post.url }}">
<strong>{{ post.title | capitalize}}</strong>
<small>{{ post.date | date_to_string }}</small>
</a>
</p>
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
You can’t perform that action at this time.