jekyll-theme-endless 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b04d7b3586e572280a4fd5247a8eaf94ec4552ce73a9481e51c833fcb6ffdc3
4
- data.tar.gz: 5c18618cdf44c90589548091abb2835f026d66668b46fab51f62e74ec3cac70a
3
+ metadata.gz: 9383008f153eb0b678be801500b2a806d5d384a77e643a8af2bb131944b62a3f
4
+ data.tar.gz: 5364902b367bb5752fa6e751a9e82a544e6b83516573ae6ee5d4594b437527b8
5
5
  SHA512:
6
- metadata.gz: af6018f32a44bb618451c96114ff690440f8683721ec866d2ea5acebe81838308297ce98e74c1d720571d79466d39884472821a33c5d245aa3fff72edd3f7a13
7
- data.tar.gz: 27b2e49ee0315ebcc171c65038b20c8a523b78f2d1e400438df31e10e193a4950c50159e21bdddde468d0e903c76a4dac4b448247e807adced8dbbd291495514
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 tags = site.tags | sort_natural %}
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 tags %}
20
- {% assign postsWithThisTag = tag | last | size %}
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 tags %}
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 | last | size %}
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 | first | replace:'-', ' ' %}
68
+ {% assign tagname = tag | replace:'-', ' ' %}
52
69
 
53
70
  <a
54
- href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag | first }}"
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>
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Endless
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
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.2
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-27 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll