lib/parade/server.rb in parade-0.10.0 vs lib/parade/server.rb in parade-0.10.1
- old
+ new
@@ -89,25 +89,31 @@
root_node
end
helpers do
+ def presentation_path_prefix
+ env['SCRIPT_NAME'].to_s
+ end
+
#
# A shortcut to define a CSS resource file within a view template
#
def css(*filepaths)
filepaths.map do |filepath|
- %{<link rel="stylesheet" href="#{File.join "css", filepath}" type="text/css"/>}
+ css_path = File.join(presentation_path_prefix,"css",filepath)
+ %{<link rel="stylesheet" href="#{css_path}" type="text/css"/>}
end.join("\n")
end
#
# A shortcut to define a Javascript resource file within a view template
#
def js(*filepaths)
filepaths.map do |filepath|
- %{<script type="text/javascript" src="#{File.join "js", filepath}"></script>}
+ js_path = File.join(presentation_path_prefix,"js",filepath)
+ %{<script type="text/javascript" src="#{js_path}"></script>}
end.join("\n")
end
def custom_resource(resource_extension)
load_presentation.resources.map do |resource_path|
@@ -171,9 +177,10 @@
def title
presentation.title
end
def slides(options = {})
+ options = { presentation_path_prefix: presentation_path_prefix }
presentation.to_html(options)
end
def footer
presentation.footer
\ No newline at end of file