octopress-capture-tag 1.0.0 → 1.0.1
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 +4 -4
- data/{test/.clash.yml → .clash.yml} +0 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +37 -25
- data/lib/octopress-capture-tag.rb +13 -2
- data/lib/octopress-capture-tag/version.rb +2 -2
- data/octopress-capture-tag.gemspec +1 -1
- metadata +4 -6
- data/test/Gemfile +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03742c875ba02ef74d85ee0f1f39ebfe122f0ed5
|
4
|
+
data.tar.gz: 781033d7fdaa0d2afe3c2f6146c8e5bf52777dc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 624c776b9917111ea6341b9955c69a654dba374857e55935fc43e7232b6a97fdc41360c48ad5e8f74664da3aafe98cd73c4e2f846bc4ee30602c35feec79ab37
|
7
|
+
data.tar.gz: e8d8f0fb8221b3d395c6c7aea02389ec5cdef12871bca55a3111399785d78f8f25a0ff803fd45057e3179d0a5425f4744e44409dfed17464cc8689ac43344a0f
|
File without changes
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
A more powerful capture liquid tag. Features:
|
4
4
|
|
5
5
|
- Conditional capture
|
6
|
+
- Filters
|
6
7
|
- Support additive assignment with `+=` operator
|
7
8
|
|
8
9
|
[](https://travis-ci.org/octopress/capture-tag)
|
@@ -11,62 +12,73 @@ A more powerful capture liquid tag. Features:
|
|
11
12
|
|
12
13
|
## Installation
|
13
14
|
|
14
|
-
|
15
|
+
If you're using bundler add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
15
16
|
|
16
|
-
|
17
|
+
group :jekyll_plugins do
|
18
|
+
gem 'octopress-capture-tag'
|
19
|
+
end
|
17
20
|
|
18
|
-
|
21
|
+
Then install the gem with Bundler
|
19
22
|
|
20
23
|
$ bundle
|
21
24
|
|
22
|
-
|
25
|
+
To install manually without bundler:
|
23
26
|
|
24
27
|
$ gem install octopress-capture-tag
|
25
28
|
|
26
|
-
|
29
|
+
Then add the gem to your Jekyll configuration.
|
27
30
|
|
28
31
|
gems:
|
29
|
-
-
|
32
|
+
-octopress-capture-tag
|
30
33
|
|
31
34
|
## Usage
|
32
35
|
|
33
36
|
Use the capture tag like normal.
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
```
|
39
|
+
{% capture var1 %}
|
40
|
+
awesome
|
41
|
+
{% endcapture %}
|
38
42
|
|
39
|
-
|
43
|
+
{{ var1 }} //=> awesome
|
44
|
+
```
|
40
45
|
|
41
46
|
Filter captured content.
|
42
47
|
|
43
|
-
|
44
|
-
|
45
|
-
|
48
|
+
```
|
49
|
+
{% capture var1 | upcase %}
|
50
|
+
awesome
|
51
|
+
{% endcapture %}
|
46
52
|
|
47
|
-
|
53
|
+
{{ var1 }} //=> AWESOME
|
54
|
+
```
|
48
55
|
|
49
56
|
Append to variables with capture.
|
50
57
|
|
51
|
-
|
52
|
-
|
53
|
-
sauce
|
54
|
-
{% endcapture %}
|
58
|
+
```
|
59
|
+
{% assign var1 = 'awesome' }}
|
55
60
|
|
56
|
-
|
61
|
+
{% capture var1 += %}
|
62
|
+
sauce
|
63
|
+
{% endcapture %}
|
64
|
+
|
65
|
+
{{ var1 }} //=> awesome sauce
|
66
|
+
```
|
57
67
|
|
58
68
|
Note: the `+=` operator will act as a normal capture if the
|
59
69
|
capture variable is `nil`.
|
60
70
|
|
61
71
|
Conditionally capture.
|
62
72
|
|
63
|
-
|
64
|
-
|
65
|
-
|
73
|
+
``
|
74
|
+
{% capture greeting if true %}
|
75
|
+
Hi Guys
|
76
|
+
{% endcapture %}
|
66
77
|
|
67
|
-
|
68
|
-
|
69
|
-
|
78
|
+
{% capture greeting unless false %}
|
79
|
+
Hi Guys
|
80
|
+
{% endcapture %}
|
81
|
+
``
|
70
82
|
|
71
83
|
## Contributing
|
72
84
|
|
@@ -4,7 +4,7 @@ require "jekyll"
|
|
4
4
|
|
5
5
|
module Octopress
|
6
6
|
module Tags
|
7
|
-
module
|
7
|
+
module Capture
|
8
8
|
class Tag < Liquid::Block
|
9
9
|
SYNTAX = /([[:word:]]+)\s*(\+=|\|\|=)?/o
|
10
10
|
|
@@ -40,4 +40,15 @@ module Octopress
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
Liquid::Template.register_tag('capture', Octopress::Tags::
|
43
|
+
Liquid::Template.register_tag('capture', Octopress::Tags::Capture::Tag)
|
44
|
+
|
45
|
+
if defined? Octopress::Docs
|
46
|
+
Octopress::Docs.add({
|
47
|
+
name: "Octopress Capture Tag",
|
48
|
+
gem: "octopress-capture-tag",
|
49
|
+
version: Octopress::Tags::Capture::VERSION,
|
50
|
+
description: "An improved Liqud capture tag supporting filters, concatenation, conditionals, and more",
|
51
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
52
|
+
source_url: "https://github.com/octopress/capture-tag"
|
53
|
+
})
|
54
|
+
end
|
@@ -5,7 +5,7 @@ require 'octopress-capture-tag/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "octopress-capture-tag"
|
8
|
-
spec.version = Octopress::Tags::
|
8
|
+
spec.version = Octopress::Tags::Capture::VERSION
|
9
9
|
spec.authors = ["Brandon Mathis"]
|
10
10
|
spec.email = ["brandon@imathis.com"]
|
11
11
|
spec.summary = %q{A powerful replacement for the Liquid capture tag}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-capture-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
|
@@ -87,8 +87,10 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".clash.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".travis.yml"
|
93
|
+
- CHANGELOG.md
|
92
94
|
- Gemfile
|
93
95
|
- LICENSE.txt
|
94
96
|
- README.md
|
@@ -96,8 +98,6 @@ files:
|
|
96
98
|
- lib/octopress-capture-tag.rb
|
97
99
|
- lib/octopress-capture-tag/version.rb
|
98
100
|
- octopress-capture-tag.gemspec
|
99
|
-
- test/.clash.yml
|
100
|
-
- test/Gemfile
|
101
101
|
- test/_config.yml
|
102
102
|
- test/_expected/index.html
|
103
103
|
- test/index.html
|
@@ -126,8 +126,6 @@ signing_key:
|
|
126
126
|
specification_version: 4
|
127
127
|
summary: A powerful replacement for the Liquid capture tag
|
128
128
|
test_files:
|
129
|
-
- test/.clash.yml
|
130
|
-
- test/Gemfile
|
131
129
|
- test/_config.yml
|
132
130
|
- test/_expected/index.html
|
133
131
|
- test/index.html
|