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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/jekyll-page-hooks.rb +24 -4
- data/lib/jekyll-page-hooks/version.rb +1 -1
- 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: affcbe58d2c8464a69873ac8cdbec36f34bf90b2
|
4
|
+
data.tar.gz: 90b1241e534fc7d669768fae0ee377e5bda381f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddb717e6325a923627c3e7df06df37a254f66b2fc8c87ba2535c565a4386e24d1fda0ad370157acff3892ac352233cd1c3c7d6c10533b653096cbd1c93076e3a
|
7
|
+
data.tar.gz: 63e35f147aca1aa0cc5fde9d0b4487e1eb2c557342a61de8560287518906e56437980fe070fa67d8558b6fc67952bc929d500c737b0d51fab1bc7d3f34025d1c
|
data/CHANGELOG.md
CHANGED
data/lib/jekyll-page-hooks.rb
CHANGED
@@ -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
|
96
|
-
self.class.to_s == 'Jekyll::
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|