octopress-include-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 +4 -0
- data/README.md +10 -1
- data/lib/octopress-include-tag.rb +11 -1
- data/lib/octopress-include-tag/version.rb +1 -1
- metadata +3 -7
- data/assets/docs/changelog.markdown +0 -8
- data/assets/docs/index.markdown +0 -98
- data/lib/octopress-include-tag/ink-plugin.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: b4954f100ac82ffeaa68b4ff940a4db6e4d7fdda
|
4
|
+
data.tar.gz: 3b7cda8eb2a96b83ed779afba4191f03c427cfd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5c8fff17abf554eb57e1c04cadbd6bb313e2939c02c4f5649e290e8dbd45a4add336b1d168979ec5a229f1c090f572ae4b32f110cf2cf0d221ebacc7154f954
|
7
|
+
data.tar.gz: 492295efca19695edc9b8eef9e8c60139a3180785ab3cbcb801b33de08837f06f83edaf0b41835f1c03f15553d0cda9e00363fe2851f42d877dd906e3d8385a8
|
File without changes
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Octopress Include Tag
|
2
2
|
|
3
|
-
This
|
3
|
+
This replaces Jekyll's include tag and adds support for conditional rendering, in-line filters and including partials from Octopress Ink plugins.
|
4
|
+
|
5
|
+
[](https://travis-ci.org/octopress/include-tag)
|
6
|
+
[](https://rubygems.org/gems/octopress-include-tag)
|
7
|
+
[](http://octopress.mit-license.org)
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -16,6 +20,11 @@ Or install it yourself as:
|
|
16
20
|
|
17
21
|
$ gem install octopress-include-tag
|
18
22
|
|
23
|
+
Next add it to your gems list in Jekyll's `_config.yml`
|
24
|
+
|
25
|
+
gems:
|
26
|
+
- octopress-include-tag
|
27
|
+
|
19
28
|
## Usage
|
20
29
|
|
21
30
|
Use this just like the regular Jekyll include tag.
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require "octopress-include-tag/version"
|
2
|
-
require "octopress-include-tag/ink-plugin"
|
3
2
|
require "octopress-tag-helpers"
|
4
3
|
require "jekyll"
|
5
4
|
|
@@ -63,3 +62,14 @@ module Octopress
|
|
63
62
|
end
|
64
63
|
|
65
64
|
Liquid::Template.register_tag('include', Octopress::Tags::IncludeTag::Tag)
|
65
|
+
|
66
|
+
if defined? Octopress::Docs
|
67
|
+
Octopress::Docs.add({
|
68
|
+
name: "Octopress Include Tag",
|
69
|
+
description: "Replaces Jekyll's include tag and adds conditional rendering, in-line filters and Octopress Ink features.",
|
70
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
71
|
+
type: "tag",
|
72
|
+
source_url: "https://github.com/octopress/include-tag"
|
73
|
+
})
|
74
|
+
end
|
75
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-include-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-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-tag-helpers
|
@@ -115,6 +115,7 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- ".clash.yml"
|
118
119
|
- ".gitignore"
|
119
120
|
- ".travis.yml"
|
120
121
|
- CHANGELOG.md
|
@@ -122,13 +123,9 @@ files:
|
|
122
123
|
- LICENSE.txt
|
123
124
|
- README.md
|
124
125
|
- Rakefile
|
125
|
-
- assets/docs/changelog.markdown
|
126
|
-
- assets/docs/index.markdown
|
127
126
|
- lib/octopress-include-tag.rb
|
128
|
-
- lib/octopress-include-tag/ink-plugin.rb
|
129
127
|
- lib/octopress-include-tag/version.rb
|
130
128
|
- octopress-include-tag.gemspec
|
131
|
-
- test/.clash.yml
|
132
129
|
- test/.gitignore
|
133
130
|
- test/Gemfile
|
134
131
|
- test/_config.yml
|
@@ -170,7 +167,6 @@ signing_key:
|
|
170
167
|
specification_version: 4
|
171
168
|
summary: A powerful include tag with conditions, filters and more
|
172
169
|
test_files:
|
173
|
-
- test/.clash.yml
|
174
170
|
- test/.gitignore
|
175
171
|
- test/Gemfile
|
176
172
|
- test/_config.yml
|
data/assets/docs/index.markdown
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: "Octopress Include Tag"
|
3
|
-
---
|
4
|
-
|
5
|
-
This tag replaces Jekyll's include and adds support for conditional rendering, in-line filters and including partials from Octopress Ink plugins.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
gem 'octopress-include-tag'
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install octopress-include-tag
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
Use this just like the regular Jekyll include tag.
|
24
|
-
|
25
|
-
{% include foo.html %} // renders _includes/foo.html
|
26
|
-
{% include foo.html happy="yep" %} // samea as above but {{ include.happy }} == "yep"
|
27
|
-
|
28
|
-
Include partials stored as a variable.
|
29
|
-
|
30
|
-
{% assign post_sidebar = "post_sidebar.html" %}
|
31
|
-
{% include post_sidebar %} // renders _includes/post_sidebar.html
|
32
|
-
|
33
|
-
Include partials conditionally, using `if`, `unless` and ternary logic.
|
34
|
-
|
35
|
-
{% include sidebar.html if site.theme.sidebar %}
|
36
|
-
{% include comments.html unless page.comments == false %}
|
37
|
-
{% include (post ? post_sidebar : page_sidebar) %}
|
38
|
-
|
39
|
-
Filter included partials.
|
40
|
-
|
41
|
-
{% include foo.html %} //=> Yo, what's up
|
42
|
-
{% include foo.html | upcase %} //=> YO, WHAT'S UP
|
43
|
-
|
44
|
-
Yes, it can handle a complex combination of features… but can you?
|
45
|
-
|
46
|
-
{% include (post ? post_sidebar : page_sidebar) | smart_quotes unless site.theme.sidebar == false %}
|
47
|
-
|
48
|
-
### Include partials with an Octopress Ink plugin.
|
49
|
-
|
50
|
-
It's easy to include a partial from an Ink theme or plugin.
|
51
|
-
|
52
|
-
Here's the syntax
|
53
|
-
|
54
|
-
{% include [plugin-slug]:[partial-name] %}
|
55
|
-
|
56
|
-
Some examples:
|
57
|
-
|
58
|
-
{% include theme:sidebar.html %} // Include the sidebar from a theme plugin
|
59
|
-
{% include twitter:feed.html %} // Include the feed from a twitter plugin
|
60
|
-
|
61
|
-
#### Overriding theme/plugin partials
|
62
|
-
|
63
|
-
Plugins and themes use this tag internally too. For example, the [octopress-feeds plugin](https://github.com/octopress/feeds/blob/master/assets/pages/article-feed.xml#L10) uses the include tag to
|
64
|
-
render partials for the RSS feed.
|
65
|
-
|
66
|
-
{% for post in site.articles %}
|
67
|
-
<entry>
|
68
|
-
{% include feeds:entry.xml %}
|
69
|
-
</entry>
|
70
|
-
{% endfor %}
|
71
|
-
|
72
|
-
|
73
|
-
If you want to make a change to the `entry.xml` partial, you could create your own version at `_plugins/feeds/includes/entry.xml`.
|
74
|
-
Now whenever `{% include feeds:entry.xml %}` is called, the include tag will use *your* local partial instead of the plugin's partial.
|
75
|
-
|
76
|
-
Note: To make overriding partials easier, you can copy all of a plugin's partials to your local override path with the Octopress Ink command:
|
77
|
-
|
78
|
-
octopress ink copy [plugin-slug] [options]
|
79
|
-
|
80
|
-
To copy all includes from the feeds plugin, you'd run:
|
81
|
-
|
82
|
-
octopress ink copy feeds --includes
|
83
|
-
|
84
|
-
This will copy all of the partials from octopress-feeds to `_plugins/feeds/includes/`. Modify any of the partials, and delete those that you want to be read from the plugin.
|
85
|
-
|
86
|
-
To list all partials from a plugin, run:
|
87
|
-
|
88
|
-
octopress ink list [plugin-slug] --includes
|
89
|
-
|
90
|
-
Note: When a plugin is updated, your local partials may be out of date, but will still override the plugin's partials. Be sure to watch changelogs and try to keep your modifications current.
|
91
|
-
|
92
|
-
## Contributing
|
93
|
-
|
94
|
-
1. Fork it ( https://github.com/octopress/include-tag/fork )
|
95
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
96
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
97
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
98
|
-
5. Create a new Pull Request
|