jekyll-handlebars 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -4
- data/lib/jekyll-handlebars.rb +11 -0
- data/lib/jekyll-handlebars/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -36,14 +36,13 @@ to your Gemfile. Create a plugin file that looks like this in you `_plugins` dir
|
|
36
36
|
|
37
37
|
Make a directory for handlebars templates `_assets/templates`. All of your templates should end
|
38
38
|
with `.template`. You'll also have to manually include [the handlebars runtime][1]
|
39
|
-
([direct link][2]) in your layouts.
|
40
|
-
|
41
|
-
template won't work.
|
39
|
+
([direct link][2]) in your layouts. After the runtime, include the liquid tag for your template. If
|
40
|
+
your template is `example.template` the liquid tag will be `{% template example %}`.
|
42
41
|
|
43
42
|
## Improvements
|
44
43
|
|
45
44
|
1. Include Handlebars to not force people to manually manage dependencies
|
46
|
-
2. Add
|
45
|
+
2. Add a md5 hash of the contents to the name for cache busting.
|
47
46
|
3. Find a way to drop the dependency on node.js, to make it easier to setup
|
48
47
|
|
49
48
|
[1]:http://handlebarsjs.com
|
data/lib/jekyll-handlebars.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'liquid'
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
module JekyllHandlebars
|
3
5
|
|
@@ -32,6 +34,15 @@ module Jekyll
|
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
37
|
+
end
|
35
38
|
|
39
|
+
module HandlebarsTags
|
40
|
+
class Template < Liquid::Tag
|
41
|
+
def render context
|
42
|
+
"<script src=\"/assets/templates/#{@markup.strip}.js\"></script>"
|
43
|
+
end
|
44
|
+
end
|
36
45
|
end
|
37
46
|
end
|
47
|
+
|
48
|
+
Liquid::Template.register_tag "template", Jekyll::HandlebarsTags::Template
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brendan Tobolaski
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2013-10-
|
17
|
+
date: 2013-10-09 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|