jekyll-handlebars 0.0.1 → 0.1.0

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.
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. You'll also have to manually include each template in your
40
- layout. They end up in `/assets/templates/<name>.js`. Be sure to include the runtime first or the
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 liquid tags for templates so people don't need to manually add templates to layouts
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Handlebars
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
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
- version: 0.0.1
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-08 00:00:00 -05:00
17
+ date: 2013-10-09 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency