utopia 0.9.60 → 0.9.61
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/utopia/link.rb +10 -10
- data/lib/utopia/middleware/content.rb +2 -2
- data/lib/utopia/version.rb +1 -1
- metadata +2 -2
data/lib/utopia/link.rb
CHANGED
@@ -52,12 +52,12 @@ module Utopia
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def href
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
@info.fetch(:uri) do
|
56
|
+
if @path
|
57
|
+
@path.to_s
|
58
|
+
else
|
59
|
+
nil
|
60
|
+
end
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -161,7 +161,7 @@ module Utopia
|
|
161
161
|
|
162
162
|
directory_link = Link.new(:directory, top + [filename, index_name], index_metadata)
|
163
163
|
|
164
|
-
# Check for localized directory metadata and update the link
|
164
|
+
# Check for localized directory metadata and update the link:
|
165
165
|
if directory_link.locale
|
166
166
|
localized_metadata = metadata.delete(name + "." + directory_link.locale)
|
167
167
|
|
@@ -176,7 +176,8 @@ module Utopia
|
|
176
176
|
end
|
177
177
|
|
178
178
|
if indices == 0
|
179
|
-
|
179
|
+
# Specify a nil uri if no index could be found for the directory:
|
180
|
+
links << Link.new(:directory, top + [filename, ""], {'uri' => nil}.merge(directory_metadata))
|
180
181
|
end
|
181
182
|
elsif filename.match(INDEX_XNODE_FILTER) && options[:indices] == false
|
182
183
|
name = $1
|
@@ -193,8 +194,7 @@ module Utopia
|
|
193
194
|
|
194
195
|
if options[:virtual]
|
195
196
|
metadata.each do |name, details|
|
196
|
-
# Given a virtual named such as "welcome.cn", merge it with metadata
|
197
|
-
# from "welcome" if it exists.
|
197
|
+
# Given a virtual named such as "welcome.cn", merge it with metadata from "welcome" if it exists:
|
198
198
|
basename, locale = name.split(".", 2)
|
199
199
|
|
200
200
|
if virtual_metadata[basename]
|
data/lib/utopia/version.rb
CHANGED