jekyll-page-hooks 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47dce060c1586eff83a979cd230f2c4f05836337
4
- data.tar.gz: 7ac52d04d541548ab1df5400240c46838cb4e3fa
3
+ metadata.gz: affcbe58d2c8464a69873ac8cdbec36f34bf90b2
4
+ data.tar.gz: 90b1241e534fc7d669768fae0ee377e5bda381f6
5
5
  SHA512:
6
- metadata.gz: c3870a7678f032967e4f26a7e5a35b2cf9eb47ec84709a104201a26672cad2b6712ca2a71812f107bac0853cf1697585580e98dd21953b299a97fa0e3dae5e49
7
- data.tar.gz: 04603483c9012303a8713818617b59d268b1a543c3042b830b4c292f33362533035c85080fd833ff0b665bbc07d9f2c68e0e9506b8997daae384d97694cff4d5
6
+ metadata.gz: ddb717e6325a923627c3e7df06df37a254f66b2fc8c87ba2535c565a4386e24d1fda0ad370157acff3892ac352233cd1c3c7d6c10533b653096cbd1c93076e3a
7
+ data.tar.gz: 63e35f147aca1aa0cc5fde9d0b4487e1eb2c557342a61de8560287518906e56437980fe070fa67d8558b6fc67952bc929d500c737b0d51fab1bc7d3f34025d1c
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.2.0
4
+ - Added support for processing partials as a ConvertiblePartial.
5
+
3
6
  ### 1.2.0
4
7
  - Added support Jekyll 2.0
5
8
 
@@ -1,7 +1,7 @@
1
1
  require 'jekyll'
2
2
 
3
3
  module Jekyll
4
-
4
+
5
5
  # Extended plugin type that allows the plugin
6
6
  # to be called on varous callback methods.
7
7
  #
@@ -79,6 +79,26 @@ module Jekyll
79
79
  end
80
80
  end
81
81
 
82
+ # Create a new page class to allow partials to trigger Jekyll Page Hooks.
83
+ class ConvertiblePartial
84
+ include Convertible
85
+
86
+ attr_accessor :name, :content, :site, :ext, :output, :data
87
+
88
+ def initialize(site, name, content)
89
+ @site = site
90
+ @name = name
91
+ @ext = File.extname(name)
92
+ @content = content
93
+ @data = { layout: "no_layout" } # hack
94
+
95
+ end
96
+
97
+ def render(payload)
98
+ do_layout(payload, { no_layout: nil })
99
+ end
100
+ end
101
+
82
102
  # Monkey patch for the Jekyll Convertible module. For the original class,
83
103
  # see: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/convertible.rb
84
104
  module Convertible
@@ -92,12 +112,12 @@ module Jekyll
92
112
  self.class.to_s == 'Octopress::Ink::Page'
93
113
  end
94
114
 
95
- def is_convertible_page?
96
- self.class.to_s == 'Jekyll::ConvertiblePage'
115
+ def is_convertible_partial?
116
+ self.class.to_s == 'Jekyll::ConvertiblePartial'
97
117
  end
98
118
 
99
119
  def is_filterable?
100
- is_post? or is_page? or is_convertible_page?
120
+ is_post? or is_page? or is_convertible_partial?
101
121
  end
102
122
 
103
123
  # Call the #pre_render methods on all of the loaded
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module PageHooksVersion
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-page-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
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-05-08 00:00:00.000000000 Z
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll