plate 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ ## Plate 0.7.6
2
+
3
+ * Allow files in assets/ directory to be reloaded in watch mode.
4
+ * Allow static assets (images) in assets/ directory
5
+
1
6
  ## Plate 0.7.5
2
7
 
3
8
  * Gem updates
@@ -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
@@ -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
@@ -3,7 +3,15 @@ module Plate
3
3
  # site exactly as it is.
4
4
  class StaticPage < Page
5
5
  def file_path
6
- base = Pathname.new(File.join(self.site.source, 'content'))
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)
@@ -1,3 +1,3 @@
1
1
  module Plate
2
- VERSION = "0.7.5" unless defined?(::Plate::VERSION)
2
+ VERSION = "0.7.6" unless defined?(::Plate::VERSION)
3
3
  end
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.5
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: 2012-12-23 00:00:00.000000000 Z
12
+ date: 2013-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport