Skip to content

Commit

Permalink
Improve Installation
Browse files Browse the repository at this point in the history
* Should add the route for the engine to your project.
* Add troubleshooting documentation
  • Loading branch information
peakpg committed May 23, 2012
1 parent 0eb7ffe commit ed0bc81
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
10 changes: 9 additions & 1 deletion README.markdown
Expand Up @@ -25,7 +25,7 @@ once is easy though:
At this point, the sitemap module will be installed and usable. The setting module will automatically be configured to use it.


##Configuration
## Configuration

The module adds a new entry under Administration > Tools labeled "Google
Sitemap" where the module can be configured.
Expand All @@ -41,5 +41,13 @@ value store provided by the Settings module.

A depth value of 0 (the default) will include all published pages.

## Troubleshooting

In your browser, when you test the /sitemaps/google.xml you will need to call it using the xml format, otherwise it will return a 406 unacceptable. This occurs since the browser is specifying it want HTML. Call like so instead:

```
http://localhost:3000/sitemaps/google.xml?format=xml
```



6 changes: 5 additions & 1 deletion lib/bcms_seo_sitemap/route_extensions.rb
@@ -1,6 +1,10 @@
module BcmsSeoSitemap::RouteExtensions
def routes_for_bcms_seo_sitemap

# Add this modules routes to the project.
def mount_bcms_seo_sitemap
match '/sitemaps/google.xml'=>'sitemaps#google', :as =>:google_sitemap
mount BcmsSeoSitemap::Engine => "/bcms_seo_sitemap"
end

alias :routes_for_bcms_seo_sitemap :mount_bcms_seo_sitemap
end
9 changes: 5 additions & 4 deletions lib/generators/bcms_seo_sitemap/install/install_generator.rb
@@ -1,10 +1,11 @@
require 'cms/module_installation'

class BcmsSeoSitemap::InstallGenerator < Cms::ModuleInstallation
add_migrations_directory_to_source_root __FILE__

# Add migrations to be copied, by uncommenting the following file and editing as needed.
# copy_migration_file 'name_of_migration'


def add_route
route 'mount_bcms_seo_sitemap'
end


end

0 comments on commit ed0bc81

Please sign in to comment.