jekyll-page-hooks 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jekyll-page-hooks.rb +15 -15
- data/lib/jekyll-page-hooks/version.rb +1 -1
- metadata +2 -2
data/lib/jekyll-page-hooks.rb
CHANGED
@@ -28,14 +28,14 @@ module Jekyll
|
|
28
28
|
# see: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/site.rb
|
29
29
|
class Site
|
30
30
|
|
31
|
-
# Instance variable to store the various
|
31
|
+
# Instance variable to store the various page_hook
|
32
32
|
# plugins that are loaded.
|
33
|
-
attr_accessor :
|
33
|
+
attr_accessor :page_hooks
|
34
34
|
|
35
|
-
# Instantiates all of the
|
35
|
+
# Instantiates all of the page_hook plugins. This is basically
|
36
36
|
# a duplication of the other loaders in Site#setup.
|
37
|
-
def
|
38
|
-
self.
|
37
|
+
def load_page_hooks
|
38
|
+
self.page_hooks = Jekyll::PageHooks.subclasses.select do |c|
|
39
39
|
!self.safe || c.safe
|
40
40
|
end.map do |c|
|
41
41
|
c.new(self.config)
|
@@ -98,38 +98,38 @@ module Jekyll
|
|
98
98
|
end
|
99
99
|
|
100
100
|
# Call the #pre_render methods on all of the loaded
|
101
|
-
#
|
101
|
+
# page_hook plugins.
|
102
102
|
#
|
103
103
|
# Returns nothing
|
104
104
|
def pre_render
|
105
|
-
self.site.
|
105
|
+
self.site.load_page_hooks unless self.site.page_hooks
|
106
106
|
|
107
|
-
if self.site.
|
108
|
-
self.site.
|
107
|
+
if self.site.page_hooks and is_filterable?
|
108
|
+
self.site.page_hooks.each do |filter|
|
109
109
|
filter.pre_render(self)
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
114
|
# Call the #post_render methods on all of the loaded
|
115
|
-
#
|
115
|
+
# page_hook plugins.
|
116
116
|
#
|
117
117
|
# Returns nothing
|
118
118
|
def post_render
|
119
|
-
if self.site.
|
120
|
-
self.site.
|
119
|
+
if self.site.page_hooks and is_filterable?
|
120
|
+
self.site.page_hooks.each do |filter|
|
121
121
|
filter.post_render(self)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
126
|
# Call the #post_write methods on all of the loaded
|
127
|
-
#
|
127
|
+
# page_hook plugins.
|
128
128
|
#
|
129
129
|
# Returns nothing
|
130
130
|
def post_write
|
131
|
-
if self.site.
|
132
|
-
self.site.
|
131
|
+
if self.site.page_hooks and is_filterable?
|
132
|
+
self.site.page_hooks.each do |filter|
|
133
133
|
filter.post_write(self)
|
134
134
|
end
|
135
135
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-page-hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|