octopress-render-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/.travis.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/README.md +62 -6
- data/Rakefile +7 -0
- data/assets/docs/changelog.markdown +13 -0
- data/assets/docs/index.markdown +87 -0
- data/lib/octopress-render-tag.rb +1 -0
- data/lib/octopress-render-tag/ink-plugin.rb +0 -0
- data/lib/octopress-render-tag/version.rb +1 -1
- data/octopress-render-tag.gemspec +2 -0
- data/test/.clash.yml +2 -0
- data/test/Gemfile +1 -0
- data/test/_config.yml +1 -3
- data/test/{expected.html → _expected/index.html} +0 -0
- data/test/_expected/license.html +22 -0
- data/test/test_render/license.html +4 -0
- metadata +42 -6
- data/test/test.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5acb80c4b4040ad60856fe838fba69f5e388efe
|
4
|
+
data.tar.gz: 44c850848b3cc59a01b1e663c0ab59c54d39dbce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 336a53eb17bb47428a0dfe24c2636d40e2f04f360698f1d63023c56cc4dcee4b62af1daa425eb749d7ec51165eb1dccea54e91c94d615ab6a06ee9a890b769ac
|
7
|
+
data.tar.gz: a62e352490234cb07e981fa050539228e0e8da1422b073dc7609bf0588efc3a7b560682e1306a07399a93291991ec55fd4f62a7a890fd3d542fa6b853717724e
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# Octopress Render Tag
|
2
2
|
|
3
|
-
|
3
|
+
Use the render tag to embed files directly from the file system. This tag also supports conditional rendering, in-line filters.
|
4
|
+
|
5
|
+
[](https://travis-ci.org/octopress/render-tag)
|
6
|
+
[](https://rubygems.org/gems/octopress-render-tag)
|
7
|
+
[](http://octopress.mit-license.org)
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
8
12
|
|
9
|
-
gem '
|
13
|
+
gem 'octopress-render-tag'
|
10
14
|
|
11
15
|
And then execute:
|
12
16
|
|
@@ -14,15 +18,67 @@ And then execute:
|
|
14
18
|
|
15
19
|
Or install it yourself as:
|
16
20
|
|
17
|
-
$ gem install
|
21
|
+
$ gem install octopress-render-tag
|
22
|
+
|
23
|
+
Next add it to your gems list in Jekyll's `_config.yml`
|
24
|
+
|
25
|
+
gems:
|
26
|
+
- octopress-render-tag
|
18
27
|
|
19
28
|
## Usage
|
20
29
|
|
21
|
-
|
30
|
+
### How file paths work
|
31
|
+
|
32
|
+
By default paths passed to the render tag are relative to the site source directory.
|
33
|
+
|
34
|
+
{% render _file.html %} // relative to site source
|
35
|
+
|
36
|
+
Relative paths like these are relative to the current file.
|
37
|
+
|
38
|
+
// some_page/test.html
|
39
|
+
|
40
|
+
{% render ./_file.html %} // renders some_page/_file.html
|
41
|
+
{% render ../other_page/_file.html %} // renders other_page/_file.html
|
42
|
+
|
43
|
+
You can even render files relative to system paths, however, remember that these renders will only work if
|
44
|
+
the site is rendered on your system. If these files move, your site will fail to build.
|
45
|
+
|
46
|
+
{% render /_file.html %} // relative to system root
|
47
|
+
{% render ~/_file.html %} // relative to system user
|
48
|
+
|
49
|
+
### Render tag features
|
50
|
+
|
51
|
+
Render partials stored as a variable.
|
52
|
+
|
53
|
+
// If a page has the YAML front-matter
|
54
|
+
// theme: _post_themes/blue.css
|
55
|
+
|
56
|
+
<style>{% render page.theme %}</style>
|
57
|
+
|
58
|
+
Render partials conditionally, using `if`, `unless` and ternary logic.
|
59
|
+
|
60
|
+
{% render ./post-footer.html if post.footer %}
|
61
|
+
{% render ./page-footer.html unless page.footer == false %}
|
62
|
+
{% render (post ? ./post-footer.html : ./page-footer.html) %}
|
63
|
+
|
64
|
+
Filter partials.
|
65
|
+
|
66
|
+
{% render ./foo.html %} //=> Yo, what's up
|
67
|
+
{% render ./foo.html | upcase %} //=> YO, WHAT'S UP
|
68
|
+
|
69
|
+
Automatic template processing.
|
70
|
+
|
71
|
+
// in some_page.html
|
72
|
+
{% render _test.md %} // outputs markdown rendered to HTML
|
73
|
+
|
74
|
+
Avoid template processing.
|
75
|
+
|
76
|
+
// in some_page.html
|
77
|
+
{% render raw _test.md %} // Markdown is not processed
|
22
78
|
|
23
79
|
## Contributing
|
24
80
|
|
25
|
-
1. Fork it ( https://github.com/
|
81
|
+
1. Fork it ( https://github.com/octopress/render-tag/fork )
|
26
82
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
83
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
84
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -1,2 +1,9 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require "octopress-ink"
|
3
|
+
|
4
|
+
desc "Copy Readme and Changelog into docs"
|
5
|
+
task :update_docs do
|
6
|
+
Octopress::Ink.copy_doc 'README.md', 'assets/docs/index.markdown'
|
7
|
+
Octopress::Ink.copy_doc 'CHANGELOG.md', 'assets/docs/changelog.markdown', '/changelog/'
|
8
|
+
end
|
2
9
|
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
title: "Octopress Render Tag"
|
3
|
+
---
|
4
|
+
|
5
|
+
Use the render tag to embed files directly from the file system. This tag also supports conditional rendering, in-line filters.
|
6
|
+
|
7
|
+
[](https://travis-ci.org/octopress/render-tag)
|
8
|
+
[](https://rubygems.org/gems/octopress-render-tag)
|
9
|
+
[](http://octopress.mit-license.org)
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'octopress-render-tag'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install octopress-render-tag
|
24
|
+
|
25
|
+
Next add it to your gems list in Jekyll's `_config.yml`
|
26
|
+
|
27
|
+
gems:
|
28
|
+
- octopress-render-tag
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
### How file paths work
|
33
|
+
|
34
|
+
By default paths passed to the render tag are relative to the site source directory.
|
35
|
+
|
36
|
+
{% render _file.html %} // relative to site source
|
37
|
+
|
38
|
+
Relative paths like these are relative to the current file.
|
39
|
+
|
40
|
+
// some_page/test.html
|
41
|
+
|
42
|
+
{% render ./_file.html %} // renders some_page/_file.html
|
43
|
+
{% render ../other_page/_file.html %} // renders other_page/_file.html
|
44
|
+
|
45
|
+
You can even render files relative to system paths, however, remember that these renders will only work if
|
46
|
+
the site is rendered on your system. If these files move, your site will fail to build.
|
47
|
+
|
48
|
+
{% render /_file.html %} // relative to system root
|
49
|
+
{% render ~/_file.html %} // relative to system user
|
50
|
+
|
51
|
+
### Render tag features
|
52
|
+
|
53
|
+
Render partials stored as a variable.
|
54
|
+
|
55
|
+
// If a page has the YAML front-matter
|
56
|
+
// theme: _post_themes/blue.css
|
57
|
+
|
58
|
+
<style>{% render page.theme %}</style>
|
59
|
+
|
60
|
+
Render partials conditionally, using `if`, `unless` and ternary logic.
|
61
|
+
|
62
|
+
{% render ./post-footer.html if post.footer %}
|
63
|
+
{% render ./page-footer.html unless page.footer == false %}
|
64
|
+
{% render (post ? ./post-footer.html : ./page-footer.html) %}
|
65
|
+
|
66
|
+
Filter partials.
|
67
|
+
|
68
|
+
{% render ./foo.html %} //=> Yo, what's up
|
69
|
+
{% render ./foo.html | upcase %} //=> YO, WHAT'S UP
|
70
|
+
|
71
|
+
Automatic template processing.
|
72
|
+
|
73
|
+
// in some_page.html
|
74
|
+
{% render _test.md %} // outputs markdown rendered to HTML
|
75
|
+
|
76
|
+
Avoid template processing.
|
77
|
+
|
78
|
+
// in some_page.html
|
79
|
+
{% render raw _test.md %} // Markdown is not processed
|
80
|
+
|
81
|
+
## Contributing
|
82
|
+
|
83
|
+
1. Fork it ( https://github.com/octopress/render-tag/fork )
|
84
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
85
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
86
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
87
|
+
5. Create a new Pull Request
|
data/lib/octopress-render-tag.rb
CHANGED
File without changes
|
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_runtime_dependency "jekyll-page-hooks", "~> 1.0"
|
23
23
|
spec.add_runtime_dependency "jekyll", "~> 2.0"
|
24
24
|
|
25
|
+
spec.add_development_dependency "clash"
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.6"
|
26
27
|
spec.add_development_dependency "rake"
|
28
|
+
spec.add_development_dependency "octopress-ink"
|
27
29
|
end
|
data/test/.clash.yml
ADDED
data/test/Gemfile
CHANGED
data/test/_config.yml
CHANGED
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Brandon Mathis
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-render-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: 2014-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-tag-helpers
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: clash
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: octopress-ink
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description: Render files inline on any Jekyll page or post
|
84
112
|
email:
|
85
113
|
- brandon@imathis.com
|
@@ -89,22 +117,28 @@ extra_rdoc_files: []
|
|
89
117
|
files:
|
90
118
|
- ".gitignore"
|
91
119
|
- ".travis.yml"
|
120
|
+
- CHANGELOG.md
|
92
121
|
- Gemfile
|
93
122
|
- LICENSE.txt
|
94
123
|
- README.md
|
95
124
|
- Rakefile
|
125
|
+
- assets/docs/changelog.markdown
|
126
|
+
- assets/docs/index.markdown
|
96
127
|
- lib/octopress-render-tag.rb
|
128
|
+
- lib/octopress-render-tag/ink-plugin.rb
|
97
129
|
- lib/octopress-render-tag/version.rb
|
98
130
|
- octopress-render-tag.gemspec
|
131
|
+
- test/.clash.yml
|
99
132
|
- test/.gitignore
|
100
133
|
- test/Gemfile
|
101
134
|
- test/_config.yml
|
135
|
+
- test/_expected/index.html
|
136
|
+
- test/_expected/license.html
|
102
137
|
- test/_test_render.md
|
103
|
-
- test/expected.html
|
104
138
|
- test/index.html
|
105
|
-
- test/test.rb
|
106
139
|
- test/test_render/_f.html
|
107
140
|
- test/test_render/_var.html
|
141
|
+
- test/test_render/license.html
|
108
142
|
homepage: https://github.com/octopress/render-tag
|
109
143
|
licenses:
|
110
144
|
- MIT
|
@@ -130,12 +164,14 @@ signing_key:
|
|
130
164
|
specification_version: 4
|
131
165
|
summary: Render files inline on any Jekyll page or post
|
132
166
|
test_files:
|
167
|
+
- test/.clash.yml
|
133
168
|
- test/.gitignore
|
134
169
|
- test/Gemfile
|
135
170
|
- test/_config.yml
|
171
|
+
- test/_expected/index.html
|
172
|
+
- test/_expected/license.html
|
136
173
|
- test/_test_render.md
|
137
|
-
- test/expected.html
|
138
174
|
- test/index.html
|
139
|
-
- test/test.rb
|
140
175
|
- test/test_render/_f.html
|
141
176
|
- test/test_render/_var.html
|
177
|
+
- test/test_render/license.html
|