octopress-render-tag 1.0.5 → 1.0.6
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/CHANGELOG.md +5 -0
- data/README.md +43 -27
- data/lib/octopress-render-tag.rb +4 -4
- data/lib/octopress-render-tag/version.rb +2 -2
- 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: 9b7bc14072b5f104f39c3dd26be2e5d59278cd4c
|
4
|
+
data.tar.gz: bfc0cb50384db2d1d1a6fd694fe913ac7ee873f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b72cb799bdfc06984ac7e99d40a7b28d3ac1cc530252cc7d961ca78b22152aa694462b6c23d170f233b94cfacd56a0fcedb4fc9efca2ac68db80fd3ff808c5
|
7
|
+
data.tar.gz: aad1715ddd874322f113948c97f8539a7de1c527bdd2f711000ffeb5cb73286b441b098c4e17ff27dda1033e10593573977b8345095caa6f25897344a83ed381
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,22 +8,24 @@ Use the render tag to embed files directly from the file system. This tag also s
|
|
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-render-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-render-tag
|
22
24
|
|
23
|
-
|
25
|
+
Then add the gem to your Jekyll configuration.
|
24
26
|
|
25
27
|
gems:
|
26
|
-
-
|
28
|
+
-octopress-render-tag
|
27
29
|
|
28
30
|
## Usage
|
29
31
|
|
@@ -31,50 +33,64 @@ Next add it to your gems list in Jekyll's `_config.yml`
|
|
31
33
|
|
32
34
|
By default paths passed to the render tag are relative to the site source directory.
|
33
35
|
|
34
|
-
|
36
|
+
```
|
37
|
+
{% render _file.html %} // relative to site source
|
38
|
+
```
|
35
39
|
|
36
40
|
Relative paths like these are relative to the current file.
|
37
41
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
+
<!-- title:"A page in the directory 'some_dir'" -->
|
43
|
+
```
|
44
|
+
{% render ./_file.html %} // renders some_dir/_file.html
|
45
|
+
{% render ../other_dir/_file.html %} // renders other_dir/_file.html
|
46
|
+
```
|
42
47
|
|
43
48
|
You can even render files relative to system paths, however, remember that these renders will only work if
|
44
49
|
the site is rendered on your system. If these files move, your site will fail to build.
|
45
50
|
|
46
|
-
|
47
|
-
|
51
|
+
```
|
52
|
+
{% render /_file.html %} // relative to system root
|
53
|
+
{% render ~/_file.html %} // relative to system user
|
54
|
+
```
|
48
55
|
|
49
56
|
### Render tag features
|
50
57
|
|
51
58
|
Render partials stored as a variable.
|
52
59
|
|
53
|
-
|
54
|
-
|
60
|
+
```html
|
61
|
+
---
|
62
|
+
theme: _post_themes/feature.css
|
63
|
+
---
|
55
64
|
|
56
|
-
|
65
|
+
<style>{% render page.theme %}</style>
|
66
|
+
```
|
57
67
|
|
58
68
|
Render partials conditionally, using `if`, `unless` and ternary logic.
|
59
69
|
|
60
|
-
|
61
|
-
|
62
|
-
|
70
|
+
```
|
71
|
+
{% render ./post-footer.html if post.footer %}
|
72
|
+
{% render ./page-footer.html unless page.footer == false %}
|
73
|
+
{% render (post ? ./post-footer.html : ./page-footer.html) %}
|
74
|
+
```
|
63
75
|
|
64
76
|
Filter partials.
|
65
77
|
|
66
|
-
|
67
|
-
|
78
|
+
```
|
79
|
+
{% render ./foo.html %} //=> Yo, what's up
|
80
|
+
{% render ./foo.html | upcase %} //=> YO, WHAT'S UP
|
81
|
+
```
|
68
82
|
|
69
|
-
Automatic template processing.
|
83
|
+
Automatic template processing. Markdown and textile files can be embedded in HTML files.
|
70
84
|
|
71
|
-
|
72
|
-
|
85
|
+
```
|
86
|
+
{% render _test.md %} // renders as html
|
87
|
+
```
|
73
88
|
|
74
|
-
|
89
|
+
If you want, you can disable template processing.
|
75
90
|
|
76
|
-
|
77
|
-
|
91
|
+
```
|
92
|
+
{% render raw _test.md %} // Markdown is not processed
|
93
|
+
```
|
78
94
|
|
79
95
|
## Contributing
|
80
96
|
|
data/lib/octopress-render-tag.rb
CHANGED
@@ -5,7 +5,7 @@ require "jekyll"
|
|
5
5
|
|
6
6
|
module Octopress
|
7
7
|
module Tags
|
8
|
-
module
|
8
|
+
module Render
|
9
9
|
class Tag < Liquid::Tag
|
10
10
|
SYNTAX = /(\S+)(.+)?/
|
11
11
|
|
@@ -95,8 +95,8 @@ module Octopress
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
Liquid::Template.register_tag('render', Octopress::Tags::
|
99
|
-
Liquid::Template.register_tag('render_partial', Octopress::Tags::
|
98
|
+
Liquid::Template.register_tag('render', Octopress::Tags::Render::Tag)
|
99
|
+
Liquid::Template.register_tag('render_partial', Octopress::Tags::Render::Tag)
|
100
100
|
|
101
101
|
if defined? Octopress::Docs
|
102
102
|
Octopress::Docs.add({
|
@@ -105,6 +105,6 @@ if defined? Octopress::Docs
|
|
105
105
|
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
106
106
|
type: "tag",
|
107
107
|
source_url: "https://github.com/octopress/render-tag",
|
108
|
-
version: Octopress::Tags::
|
108
|
+
version: Octopress::Tags::Render::VERSION
|
109
109
|
})
|
110
110
|
end
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-tag-helpers
|