jekyll-tags 0.0.1 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2Q3ZTAyYmU3NDU4ZWZlN2IwNmYzNjI3MGRhNTBjZTFiOTVmZGFkZg==
4
+ MGM1MWFlOTViZWY3NDM2Mjg0NTE5YmQ2NGJkNjczNjQxNmNlYWEzOA==
5
5
  data.tar.gz: !binary |-
6
- ODJjYWU0NzMxMGJmMjQ5Y2FkYWQ2M2M0YzM5MTAzMzIxMzJjZTk2NA==
6
+ ZDQxNDY3OThiOGRhZjRjYzZhNWYxNGFmYmIyZDdkMjM0MjFjODMxOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTIzZGQyYzljMzhjODJiNTA5ZWMyNzIxZDRlNDNkZDQxZmQ1YmYyYWQ3Yzkz
10
- ZmNkOGIxNWM1ZjViNjc5ZTY4YTlhMmRjODI1ZDNiMjY1NWU1MmZiMDNiZDUy
11
- MDUwYTlkZjgyZGIwMTE1ZTMwZGFlOTJlMGM0NmIwMTRjNGZjMjk=
9
+ NzVhYjgzN2U3ZmIzZjczNjVjMzNiZWJlZTE0NDE0YzkxYmE3YTU2MmFiNDQ1
10
+ N2Q0NGE5MGYxZWJkNDdiYzk5ZGZjY2M0OGNkOWRiODg3YmI5Y2EyZTViMzBj
11
+ MmFjMTI3ZWI3MDA5OGY1YWNiMmRiZWI5NmZmMDllZDFlMmRiNTU=
12
12
  data.tar.gz: !binary |-
13
- ODdlOTE4YzQwYTZhMmJlMTU1ZmZhYjA1YWEwOTM0OTcwNzEyZDVhY2JmZGY2
14
- ODU1OTYyMjIzNjcwYjk1MjhhOWJiNDdkODA3M2YyNWZlMDM5ZTYwZDY5NmE2
15
- OTE2YWEyMDdlYWU4NTlkZTYzODU2N2E1M2Y1Mzc2OGU3NTRhODg=
13
+ ZGEwYzBmYzU1ZmZlYjk1OWFiYzQzOTJjMzkzNjFmOTNjZDM5Y2M3ZTAxMTEy
14
+ Mjg3NDUwMWRkOGJiNGE1MDVhYmZiZTcyNTBjMjllYjk5OWNlMDE5OWMxNzg2
15
+ NWI2NzQ0NzIxOGU1OTQ3NmU5ZWRkNDNiZDA0ZTE4MGM3NTYzYTI=
data/README.md CHANGED
@@ -1,22 +1,36 @@
1
1
  # Jekyll::Tags
2
2
 
3
+ Jekyll plugin for generate a tag cloud.
4
+
3
5
  ## Installation
4
6
 
5
- Add this line to your application's Gemfile:
7
+ Install it yourself as:
6
8
 
7
- gem 'jekyll-tags'
9
+ $ gem install jekyll-tags
8
10
 
9
- And then execute:
11
+ ## Usage
10
12
 
11
- $ bundle
13
+ Add follow line into `_plugins/ext.rb`
12
14
 
13
- Or install it yourself as:
15
+ require 'jekyll/tags'
14
16
 
15
- $ gem install jekyll-tags
17
+ Now you must create a tag cloud. For example in `some_page.html`
16
18
 
17
- ## Usage
19
+ ````html
20
+ <div id="tag-cloud">
21
+ <h3>Tags</h3>
22
+ {% assign tags = site.tags | tag_cloud_build %}
23
+ {% for tag in tags %}
24
+ <span class="tag" style="font-size: {{tag.last}}em;">
25
+ {{ tag.first }}
26
+ </span>
27
+ {% endfor %}
28
+ </div>
29
+ ````
18
30
 
19
- TODO: Write usage instructions here
31
+ When you use filter `site.tags | tag_cloud_build` you pass into filter
32
+ `site.tags` and take array like `[[tag1, 1], [tag2, 2], [tag3, 10]]`
33
+ First element is a you tag. Second is a frequency.
20
34
 
21
35
  ## Contributing
22
36
 
@@ -25,3 +39,8 @@ TODO: Write usage instructions here
25
39
  3. Commit your changes (`git commit -am 'Add some feature'`)
26
40
  4. Push to the branch (`git push origin my-new-feature`)
27
41
  5. Create new Pull Request
42
+
43
+
44
+ ## License
45
+
46
+ The MIT License
data/lib/jekyll/tags.rb CHANGED
@@ -2,6 +2,9 @@ require "jekyll/tags/version"
2
2
 
3
3
  module Jekyll
4
4
  module Tags
5
- # Your code goes here...
5
+ def tag_cloud_build(input)
6
+ input.map{|k, v| [k, v.size] }
7
+ end
6
8
  end
7
9
  end
10
+ Liquid::Template.register_filter(Jekyll::Tags)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Tags
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fntzr