lib/staticky/resources/plugins/prelude.rb in staticky-0.2.0 vs lib/staticky/resources/plugins/prelude.rb in staticky-0.3.0
- old
+ new
@@ -13,19 +13,21 @@
end
end
end
module InstanceMethods
- def filepath
- destination.join(basename)
+ def build_path
+ destination.join(filepath)
end
- def read
- filepath.read
+ def filepath
+ return Pathname.new("index.html") if root?
+
+ Pathname.new("#{uri.path.gsub(%r{^/}, "")}.html")
end
- def basename
- root? ? "index.html" : "#{url}.html"
+ def read
+ Staticky.files.read(build_path)
end
def root?
url == "/"
end