lib/middleman/features/slickmap.rb in middleman-1.0.0 vs lib/middleman/features/slickmap.rb in middleman-1.0.1

- old
+ new

@@ -3,17 +3,18 @@ module Middleman::Features::Slickmap class << self def registered(app) require 'slickmap' - @sitemap_url = config[:url] || "sitemap.html" + @sitemap_url = "sitemap.html" + @sitemap_url = app.sitemap_url if app.respond_to?(:slickmap_url) - if Middleman::Server.environment == :build + if app.environment == :build Middleman::Builder.template :slickmap, @sitemap_url, @sitemap_url end - Middleman::Server.helpers do + app.helpers do def sitemap_node(n, first=false) if n.children.length < 1 if !first && File.extname(n.dir).length > 0 haml_tag :li do path = n.dir.gsub(self.class.views, '') @@ -43,11 +44,11 @@ end end end end - Middleman::Server.get "/#{@sitemap_url}" do + app.get "/#{@sitemap_url}" do # Return :utility to put it util top menu. False to ignore @tree, @utility = Middleman::Features::Slickmap.build_sitemap do |file_name| :valid end @@ -84,6 +85,6 @@ end end entry end -end \ No newline at end of file +end