Created
February 2, 2013 22:49
-
-
Save tdreyno/4699599 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store somewhere | |
class SitemapGenerator | |
def initialize(app) | |
@app = app | |
end | |
def manipulate_resource_list(resources) | |
sitemap_builder = ::Middleman::Sitemap::Resource.new( | |
@app.sitemap, | |
"sitemap.xml", # The URL | |
File.join(File.dirname(__FILE__), 'source', 'sitemap.xml.builder') # Path to your template | |
) | |
resources << sitemap_builder | |
resources | |
end | |
end | |
# In your extension register/setup method | |
app.after_configuration do | |
sitemap.register_resource_list_manipulator(:sitemap_generator, | |
SitemapGenerator.new(self), | |
false) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update: Thomas fixed this issue in c9290c6.