octopress-filter-tag 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -25
- data/lib/octopress-filter-tag/version.rb +2 -2
- data/lib/octopress-filter-tag.rb +13 -2
- data/octopress-filter-tag.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20761113278598dad3e26e88d150f5b96a6d093a
|
4
|
+
data.tar.gz: 42aabfe0d773a17e0dd70845ea068bb995d5d3b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e84c58324e5b3e732ae735d22fb51be69194090989d6b7aeedfad035fe99a29b52b7799504d46d5d973d521793f98806963eb2fb4836e956b4d3bf0554e80fd
|
7
|
+
data.tar.gz: 3249ec1d4e1cd0c649ceaf2ac75fc82e5a9b4e8a3173d7c22cde809f585faa5062c4bda7fd5a5876508f73700dbaf9da48f56b4d6a63fba4a115193aa145d098
|
data/README.md
CHANGED
@@ -8,55 +8,62 @@ A Liquid block tag which can conditionally filter its content.
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
|
11
|
+
If you're using bundler add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
12
12
|
|
13
|
-
|
13
|
+
group :jekyll_plugins do
|
14
|
+
gem 'octopress-filter-tag'
|
15
|
+
end
|
14
16
|
|
15
|
-
|
17
|
+
Then install the gem with Bundler
|
16
18
|
|
17
19
|
$ bundle
|
18
20
|
|
19
|
-
|
21
|
+
To install manually without bundler:
|
20
22
|
|
21
23
|
$ gem install octopress-filter-tag
|
22
24
|
|
23
|
-
|
25
|
+
Then add the gem to your Jekyll configuration.
|
24
26
|
|
25
27
|
gems:
|
26
|
-
-
|
28
|
+
-octopress-filter-tag
|
27
29
|
|
28
30
|
## Usage
|
29
31
|
|
30
32
|
Syntax:
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
```
|
35
|
+
{% filter [filters] %}
|
36
|
+
some sort of content
|
37
|
+
{% endfilter %}
|
38
|
+
```
|
35
39
|
|
36
40
|
Simple filter usage.
|
37
41
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
//=> KITTENS.
|
42
|
+
```
|
43
|
+
{% filter upcase %}
|
44
|
+
kittens.
|
45
|
+
{% endfilter %}
|
43
46
|
|
44
|
-
|
45
|
-
kittens??
|
46
|
-
{% endfilter %}
|
47
|
-
|
48
|
-
//=> KITTENS!!
|
47
|
+
//=> KITTENS.
|
49
48
|
|
50
|
-
|
49
|
+
{% filter upcase | replace: "?","!" %}
|
50
|
+
kittens??
|
51
|
+
{% endfilter %}
|
52
|
+
|
53
|
+
//=> KITTENS!!
|
54
|
+
```
|
51
55
|
|
52
|
-
|
56
|
+
Conditional filtering
|
53
57
|
|
54
|
-
|
55
|
-
|
56
|
-
{% endfilter %}
|
58
|
+
```
|
59
|
+
{% assign shouting = true %}
|
57
60
|
|
58
|
-
|
61
|
+
{% filter | upcase if shouting %}
|
62
|
+
What's going on?
|
63
|
+
{% endfilter %}
|
59
64
|
|
65
|
+
//=> WHAT'S GOING ON?
|
66
|
+
```
|
60
67
|
|
61
68
|
## Contributing
|
62
69
|
|
data/lib/octopress-filter-tag.rb
CHANGED
@@ -4,7 +4,7 @@ require "jekyll"
|
|
4
4
|
|
5
5
|
module Octopress
|
6
6
|
module Tags
|
7
|
-
module
|
7
|
+
module Filter
|
8
8
|
class Tag < Liquid::Block
|
9
9
|
def initialize(tag_name, markup, tokens)
|
10
10
|
super
|
@@ -29,4 +29,15 @@ module Octopress
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
Liquid::Template.register_tag('filter', Octopress::Tags::
|
32
|
+
Liquid::Template.register_tag('filter', Octopress::Tags::Filter::Tag)
|
33
|
+
|
34
|
+
if defined? Octopress::Docs
|
35
|
+
Octopress::Docs.add({
|
36
|
+
name: "Octopress Filter Tag",
|
37
|
+
gem: "octopress-filter-tag",
|
38
|
+
version: Octopress::Tags::Filter::VERSION,
|
39
|
+
description: "",
|
40
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
41
|
+
source_url: "https://github.com/octopress/filter-tag"
|
42
|
+
})
|
43
|
+
end
|
@@ -5,7 +5,7 @@ require 'octopress-filter-tag/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "octopress-filter-tag"
|
8
|
-
spec.version = Octopress::Tags::
|
8
|
+
spec.version = Octopress::Tags::Filter::VERSION
|
9
9
|
spec.authors = ["Brandon Mathis"]
|
10
10
|
spec.email = ["brandon@imathis.com"]
|
11
11
|
spec.summary = %q{A Liquid block tag which can conditionally filter its content}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-filter-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-tag-helpers
|