plate 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/plate/builder.rb +2 -2
- data/lib/plate/partial.rb +3 -1
- data/lib/plate/static_page.rb +9 -1
- data/lib/plate/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/plate/builder.rb
CHANGED
@@ -148,7 +148,7 @@ module Plate
|
|
148
148
|
#
|
149
149
|
# @return [Boolean]
|
150
150
|
def reloadable?(relative_file)
|
151
|
-
relative_file =~ /^\/?(content|layouts|posts)\/(.*?)/
|
151
|
+
relative_file =~ /^\/?(assets|content|layouts|posts)\/(.*?)/
|
152
152
|
end
|
153
153
|
|
154
154
|
# Start the rendering of the site based on the provided, source, destination and
|
@@ -262,7 +262,7 @@ module Plate
|
|
262
262
|
if File.basename(relative_file_path) =~ /^_/
|
263
263
|
log("Partial modified. Reloading referencing files", :indent)
|
264
264
|
|
265
|
-
name = Partial.name(site, relative_file_path.gsub(/^\/?content\//, ''))
|
265
|
+
name = Partial.name(site, relative_file_path.gsub(/^\/?(content|assets)\//, ''))
|
266
266
|
partial = Partial.find(site, name)
|
267
267
|
|
268
268
|
if partial
|
data/lib/plate/partial.rb
CHANGED
@@ -22,7 +22,9 @@ module Plate
|
|
22
22
|
|
23
23
|
# The content for the current partial using the given locals hash
|
24
24
|
def render(locals = {})
|
25
|
-
@locals = locals.symbolize_keys
|
25
|
+
@locals = locals.symbolize_keys
|
26
|
+
@locals_proxy = nil
|
27
|
+
|
26
28
|
result = self.rendered_body
|
27
29
|
@locals = nil
|
28
30
|
@locals_proxy = nil
|
data/lib/plate/static_page.rb
CHANGED
@@ -3,7 +3,15 @@ module Plate
|
|
3
3
|
# site exactly as it is.
|
4
4
|
class StaticPage < Page
|
5
5
|
def file_path
|
6
|
-
|
6
|
+
content_dir = File.join(self.site.source, 'content')
|
7
|
+
assets_dir = File.join(self.site.source, 'assets')
|
8
|
+
|
9
|
+
base = Pathname.new(content_dir)
|
10
|
+
|
11
|
+
if self.file.to_s.start_with?(assets_dir)
|
12
|
+
base = Pathname.new(assets_dir)
|
13
|
+
end
|
14
|
+
|
7
15
|
current = Pathname.new(self.file)
|
8
16
|
|
9
17
|
dirs = current.relative_path_from(base)
|
data/lib/plate/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
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:
|
12
|
+
date: 2013-01-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|