jekyll-theme-endless 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/function_tag-cloud.html +24 -7
- data/lib/jekyll-theme-endless/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9383008f153eb0b678be801500b2a806d5d384a77e643a8af2bb131944b62a3f
|
4
|
+
data.tar.gz: 5364902b367bb5752fa6e751a9e82a544e6b83516573ae6ee5d4594b437527b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4970875e16f5f5257fcc4defe679de7ce4452b7e4e5eac1f0d115926d32738edd95613f8af50e51cb1c063faf2dfe5ef34ac8abcdc65b4493e825da2a29291e
|
7
|
+
data.tar.gz: 926e1e3779d2799122fddc966d0110a42fd4d6d873a89749f32420e0e73ebc565a27510250d0ce5eb64aa235cf7eb8402df07ad37402361c9f5f8c1011154c1a
|
@@ -1,7 +1,24 @@
|
|
1
1
|
{% comment %}
|
2
|
+
Creates a tag cloud with tags beeing sized according to the number of occurences in blog posts.
|
3
|
+
{% endcomment %}
|
2
4
|
|
5
|
+
{% comment %}
|
6
|
+
Create an empty array.
|
7
|
+
{% endcomment %}
|
8
|
+
{% assign tags = "" | split:"" %}
|
9
|
+
|
10
|
+
{% comment %}
|
11
|
+
Fill the tags-array with tag-names.
|
12
|
+
The push-filter is a Jekyll specific filter.
|
13
|
+
{% endcomment %}
|
14
|
+
{% for tag in site.tags %}
|
15
|
+
{% assign tags = tags | push: tag.first %}
|
16
|
+
{% endfor %}
|
17
|
+
|
18
|
+
{% comment %}
|
19
|
+
Sort the tag-array case-insensitive.
|
3
20
|
{% endcomment %}
|
4
|
-
{% assign
|
21
|
+
{% assign tags_sorted = tags | sort_natural %}
|
5
22
|
|
6
23
|
{% comment %}
|
7
24
|
Requirements:
|
@@ -16,8 +33,8 @@ Assumption: Non of the tags occurs more than one million times.
|
|
16
33
|
{% assign min = 1000000 %}
|
17
34
|
{% assign max = 0 %}
|
18
35
|
|
19
|
-
{% for tag in
|
20
|
-
{% assign postsWithThisTag = tag |
|
36
|
+
{% for tag in tags_sorted %}
|
37
|
+
{% assign postsWithThisTag = site.tags[tag] | size %}
|
21
38
|
{% if postsWithThisTag > max %}
|
22
39
|
{% assign max = postsWithThisTag %}
|
23
40
|
{% endif %}
|
@@ -31,7 +48,7 @@ Assumption: Non of the tags occurs more than one million times.
|
|
31
48
|
|
32
49
|
<ul class="tag-cloud list-unstyled">
|
33
50
|
|
34
|
-
{% for tag in
|
51
|
+
{% for tag in tags_sorted %}
|
35
52
|
<li>
|
36
53
|
{% comment %}
|
37
54
|
The size difference should be 150%.
|
@@ -46,12 +63,12 @@ Assumption: Non of the tags occurs more than one million times.
|
|
46
63
|
To be on the safe side, create a float (times: 1.0)
|
47
64
|
{% endcomment %}
|
48
65
|
|
49
|
-
{% assign number = tag |
|
66
|
+
{% assign number = site.tags[tag] | size %}
|
50
67
|
{% assign percent = number | times: 1.0 | minus: min | times: sizeDifference | divided_by: steps | plus: 100 %}
|
51
|
-
{% assign tagname = tag |
|
68
|
+
{% assign tagname = tag | replace:'-', ' ' %}
|
52
69
|
|
53
70
|
<a
|
54
|
-
href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag
|
71
|
+
href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag }}"
|
55
72
|
style = "font-size: {{ percent }}%"
|
56
73
|
title = "Number of posts with the tag '{{ tagname }}': {{ number }}"
|
57
74
|
>{{ tagname }}</a>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-endless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Boekhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|