Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Tag Cloud Page. #164

Merged
merged 1 commit into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _assets/stylesheets/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ img {
::selection {
color: $white;
background-color: $gray-darkest;
}
}
1 change: 1 addition & 0 deletions _assets/stylesheets/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ $article-paginator-color-hover: $gray-lightest;
@import "modules/header";
@import "modules/highlights-dark";
@import "modules/scrollappear";
@import "modules/tags";
1 change: 1 addition & 0 deletions _assets/stylesheets/light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ $article-paginator-color-hover: $gray-darkest;
@import "modules/header";
@import "modules/highlights-light";
@import "modules/scrollappear";
@import "modules/tags";
19 changes: 19 additions & 0 deletions _assets/stylesheets/modules/_tags.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// =============================================================================
// Tags
// =============================================================================

.tags-page-header {
margin-top: 0px;
}

.tags-page {
text-align: center;
padding: 50px 0;
h1 {
margin: 0 0 15px 0;
}
}

.tag-cloud {
text-decoration: none;
}
40 changes: 40 additions & 0 deletions tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
layout: default
title: "Tags"
description: "Tag cloud from all the posts"
permalink: /tags
sitemap: false
---

<div class="tags-page">
<h1 class="tags-page-header">
Tags
</h1>

{% assign my_tags = site.collections | where: "label", "my_tags" | first %}

{% assign sorted_tags = site.tags | sort %}

{% for tag in sorted_tags %}

{% assign tag_slug = tag | first %}
{% assign upcase_tag_slug = tag_slug | upcase %}
{% assign no_of_posts = tag | last | size %}

{% for my_tag in my_tags.docs %}
{% if tag_slug == my_tag.slug %}
{% assign tag_name = my_tag.name %}
{% endif %}
{% endfor %}
{% assign upcase_tag_name = tag_name | upcase %}

{% if upcase_tag_slug != "PROJECT" %}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a class="tag-cloud" href="{{ 'tag/' | relative_url }}{{ tag_slug }}" title="See all posts by {{ upcase_tag_name }} tag"
style="font-size: {{ no_of_posts | times: 15 | plus: 120 }}%">
<span>{{ upcase_tag_name }}<small>({{ no_of_posts }})</small></span>
</a>
{% endif %}

{% endfor %}
</div>