plate 0.5.2 → 0.5.3
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/asset.rb +6 -3
- data/lib/plate/sass_template.rb +6 -6
- data/lib/plate/site.rb +5 -1
- data/lib/plate/version.rb +1 -1
- metadata +14 -14
data/CHANGELOG.md
CHANGED
data/lib/plate/asset.rb
CHANGED
@@ -18,13 +18,17 @@ module Plate
|
|
18
18
|
"#{directory}/#{file_name}"
|
19
19
|
end
|
20
20
|
|
21
|
+
def pathname
|
22
|
+
File.dirname(self.file)
|
23
|
+
end
|
24
|
+
|
21
25
|
# Same as page, but no layout applied
|
22
26
|
def rendered_content
|
23
27
|
return @rendered_content if @rendered_content
|
24
28
|
|
25
29
|
result = File.read(file)
|
26
30
|
|
27
|
-
self.engines.each do |engine|
|
31
|
+
self.engines.each do |engine|
|
28
32
|
template = engine.new() { result }
|
29
33
|
result = template.render(self, :site => self.site)
|
30
34
|
end
|
@@ -36,9 +40,8 @@ module Plate
|
|
36
40
|
# in copying the file over to the destination
|
37
41
|
def write!
|
38
42
|
path = File.join(site.build_destination, file_path)
|
39
|
-
|
40
43
|
FileUtils.mkdir_p(File.dirname(path))
|
41
|
-
|
44
|
+
|
42
45
|
File.open(path, 'w') do |f|
|
43
46
|
f.write(self.rendered_content)
|
44
47
|
end
|
data/lib/plate/sass_template.rb
CHANGED
@@ -25,14 +25,14 @@ module Plate
|
|
25
25
|
options = {
|
26
26
|
:filename => eval_file,
|
27
27
|
:line => line,
|
28
|
-
:syntax => syntax
|
28
|
+
:syntax => syntax,
|
29
|
+
:style => :expanded,
|
30
|
+
:load_paths => [ scope.pathname ]
|
29
31
|
}
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
options[:cache_location] = File.join(locals[:site].cache_location, 'sass-cache')
|
35
|
-
end
|
33
|
+
if scope.site.cache_location
|
34
|
+
options[:cache_location] = File.join(scope.site.cache_location, 'sass-cache')
|
35
|
+
end
|
36
36
|
|
37
37
|
::Sass::Engine.new(data, options).render
|
38
38
|
end
|
data/lib/plate/site.rb
CHANGED
@@ -200,8 +200,12 @@ module Plate
|
|
200
200
|
unless File.directory?(file)
|
201
201
|
# Check for assets that need to be compiled. Currently only looks to see if the file
|
202
202
|
# ends in .coffee, .scss or .sass.
|
203
|
+
#
|
204
|
+
# Assets that start with _ are assumed to be partials and are not loaded.
|
203
205
|
if asset_engine_extensions.include?(File.extname(file))
|
204
|
-
|
206
|
+
unless File.basename(file).start_with?('_')
|
207
|
+
@assets << Asset.new(self, file)
|
208
|
+
end
|
205
209
|
else
|
206
210
|
# Check for YAML meta header. If it starts with ---, then process it as a page
|
207
211
|
intro = File.open(file) { |f| f.read(3) }
|
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.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70129250117980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70129250117980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: directory_watcher
|
27
|
-
requirement: &
|
27
|
+
requirement: &70129250117600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70129250117600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: i18n
|
38
|
-
requirement: &
|
38
|
+
requirement: &70129250117060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.6'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70129250117060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &70129250116640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70129250116640
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: redcarpet
|
60
|
-
requirement: &
|
60
|
+
requirement: &70129250116100 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '2'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70129250116100
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: tilt
|
71
|
-
requirement: &
|
71
|
+
requirement: &70129250115600 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '1.3'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70129250115600
|
80
80
|
description: Plate is a simple, static site generator and blog engine.
|
81
81
|
email:
|
82
82
|
- john@johntornow.com
|