hydeweb 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +5 -0
- data/lib/hyde/page.rb +7 -2
- data/lib/hyde.rb +1 -1
- metadata +1 -1
data/HISTORY.md
CHANGED
data/lib/hyde/page.rb
CHANGED
@@ -10,6 +10,9 @@ class Page
|
|
10
10
|
site = lambda { |*x| File.join site_path, *(x.compact) }
|
11
11
|
try = lambda { |_id| p = new(_id, project); p if p.exists? }
|
12
12
|
|
13
|
+
# For paths like '/' or '/hello/'
|
14
|
+
nonfile = File.basename(id).gsub('/','').empty?
|
15
|
+
|
13
16
|
# Account for:
|
14
17
|
# ~/mysite/site/about/us.html.haml
|
15
18
|
# about/us.html.haml => ~/mysite/site/about/us.html.haml
|
@@ -19,8 +22,10 @@ class Page
|
|
19
22
|
#
|
20
23
|
page = try[id]
|
21
24
|
page ||= try[site[id]]
|
22
|
-
|
23
|
-
|
25
|
+
unless nonfile
|
26
|
+
page ||= try[Dir[site["#{id}.*"]].first]
|
27
|
+
page ||= try[Dir[site["#{id.to_s.sub(/\.[^\.]*/,'')}.*"]].first]
|
28
|
+
end
|
24
29
|
page ||= try[Dir[site[id, "index.*"]].first]
|
25
30
|
|
26
31
|
# Subclass
|
data/lib/hyde.rb
CHANGED