siteleaf 0.9.10 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/siteleaf/server.rb +6 -5
- data/lib/siteleaf/version.rb +1 -1
- metadata +2 -2
data/lib/siteleaf/server.rb
CHANGED
@@ -50,7 +50,7 @@ module Siteleaf
|
|
50
50
|
template_data = nil
|
51
51
|
is_asset = /^(?!(sitemap|feed)\.xml)(assets|.*\.)/.match(path)
|
52
52
|
|
53
|
-
if is_asset
|
53
|
+
if is_asset and !File.exist?("#{path}.liquid")
|
54
54
|
output = site.resolve(url)
|
55
55
|
if output.code == 200
|
56
56
|
require 'open-uri'
|
@@ -60,7 +60,7 @@ module Siteleaf
|
|
60
60
|
[output.code, {'Content-Type' => 'text/html'}, [output.to_s]]
|
61
61
|
end
|
62
62
|
else
|
63
|
-
if template_data = resolve_template(url)
|
63
|
+
if (File.exist?("#{path}.liquid") and template_data = File.read("#{path}.liquid")) or (template_data = resolve_template(url))
|
64
64
|
# compile liquid includes into a single page
|
65
65
|
include_tags = /\{\%\s+include\s+['"]([A-Za-z0-9_\-\/]+)['"]\s+\%\}/
|
66
66
|
while include_tags.match(template_data)
|
@@ -69,10 +69,11 @@ module Siteleaf
|
|
69
69
|
end
|
70
70
|
|
71
71
|
output = site.preview(url, template_data)
|
72
|
-
if output.code == 200
|
73
|
-
|
72
|
+
if output.code == 200 && output.headers[:content_type]
|
73
|
+
puts output.class
|
74
|
+
[output.code, {'Content-Type' => output.headers[:content_type]}, [output.to_s]]
|
74
75
|
else
|
75
|
-
[output.code, {'Content-Type' => 'text/html'}, [output]]
|
76
|
+
[output.code, {'Content-Type' => 'text/html'}, [output.to_s]]
|
76
77
|
end
|
77
78
|
end
|
78
79
|
end
|
data/lib/siteleaf/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siteleaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
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-
|
12
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|