massimo 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/massimo/javascript.rb +1 -1
- data/lib/massimo/page.rb +22 -16
- data/lib/massimo/stylesheet.rb +1 -1
- data/lib/massimo.rb +1 -1
- metadata +2 -2
data/lib/massimo/javascript.rb
CHANGED
data/lib/massimo/page.rb
CHANGED
@@ -51,27 +51,33 @@ module Massimo
|
|
51
51
|
protected
|
52
52
|
|
53
53
|
def read_source
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
54
|
+
case source_path.extname
|
55
|
+
when '.yml', '.yaml'
|
56
|
+
@meta_data = (YAML.load(source_path.read) || {}).symbolize_keys
|
57
|
+
@content = @meta_data[:content] || ''
|
58
|
+
else
|
59
|
+
@line = nil
|
60
|
+
@content = ''
|
61
|
+
front_matter = false
|
62
|
+
meta_data = ''
|
63
|
+
|
64
|
+
source_path.open do |file|
|
65
|
+
file.each do |line|
|
66
|
+
if line =~ /\A---\s*\Z/
|
67
|
+
front_matter = !front_matter
|
66
68
|
else
|
67
|
-
|
68
|
-
|
69
|
+
if front_matter
|
70
|
+
meta_data << line
|
71
|
+
else
|
72
|
+
@line ||= file.lineno
|
73
|
+
@content << line
|
74
|
+
end
|
69
75
|
end
|
70
76
|
end
|
71
77
|
end
|
78
|
+
|
79
|
+
@meta_data = (YAML.load(meta_data) || {}).symbolize_keys
|
72
80
|
end
|
73
|
-
|
74
|
-
@meta_data = (YAML.load(meta_data) || {}).symbolize_keys
|
75
81
|
end
|
76
82
|
|
77
83
|
def method_missing(method, *args, &block)
|
data/lib/massimo/stylesheet.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Massimo
|
2
2
|
class Stylesheet < Massimo::Resource
|
3
3
|
def render
|
4
|
-
case source_path.extname
|
4
|
+
case source_path.extname
|
5
5
|
when '.sass', '.scss'
|
6
6
|
require 'sass' unless defined?(Sass)
|
7
7
|
options = Massimo.config.options_for(:sass).merge(:css_filename => output_path)
|
data/lib/massimo.rb
CHANGED