Skip to content

Commit 14c64d2

Browse files
xRahulnielsenramon
authored andcommitted
Adding Tag Cloud Page.
1 parent 1212d07 commit 14c64d2

File tree

5 files changed

+62
-1
lines changed

5 files changed

+62
-1
lines changed

_assets/stylesheets/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ img {
158158
::selection {
159159
color: $white;
160160
background-color: $gray-darkest;
161-
}
161+
}

_assets/stylesheets/dark.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ $article-paginator-color-hover: $gray-lightest;
6767
@import "modules/header";
6868
@import "modules/highlights-dark";
6969
@import "modules/scrollappear";
70+
@import "modules/tags";

_assets/stylesheets/light.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ $article-paginator-color-hover: $gray-darkest;
6767
@import "modules/header";
6868
@import "modules/highlights-light";
6969
@import "modules/scrollappear";
70+
@import "modules/tags";
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// =============================================================================
2+
// Tags
3+
// =============================================================================
4+
5+
.tags-page-header {
6+
margin-top: 0px;
7+
}
8+
9+
.tags-page {
10+
text-align: center;
11+
padding: 50px 0;
12+
h1 {
13+
margin: 0 0 15px 0;
14+
}
15+
}
16+
17+
.tag-cloud {
18+
text-decoration: none;
19+
}

tags.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: default
3+
title: "Tags"
4+
description: "Tag cloud from all the posts"
5+
permalink: /tags
6+
sitemap: false
7+
---
8+
9+
<div class="tags-page">
10+
<h1 class="tags-page-header">
11+
Tags
12+
</h1>
13+
14+
{% assign my_tags = site.collections | where: "label", "my_tags" | first %}
15+
16+
{% assign sorted_tags = site.tags | sort %}
17+
18+
{% for tag in sorted_tags %}
19+
20+
{% assign tag_slug = tag | first %}
21+
{% assign upcase_tag_slug = tag_slug | upcase %}
22+
{% assign no_of_posts = tag | last | size %}
23+
24+
{% for my_tag in my_tags.docs %}
25+
{% if tag_slug == my_tag.slug %}
26+
{% assign tag_name = my_tag.name %}
27+
{% endif %}
28+
{% endfor %}
29+
{% assign upcase_tag_name = tag_name | upcase %}
30+
31+
{% if upcase_tag_slug != "PROJECT" %}
32+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
33+
<a class="tag-cloud" href="{{ 'tag/' | relative_url }}{{ tag_slug }}" title="See all posts by {{ upcase_tag_name }} tag"
34+
style="font-size: {{ no_of_posts | times: 15 | plus: 120 }}%">
35+
<span>{{ upcase_tag_name }}<small>({{ no_of_posts }})</small></span>
36+
</a>
37+
{% endif %}
38+
39+
{% endfor %}
40+
</div>

0 commit comments

Comments
 (0)