Skip to content

Commit

Permalink
Adding homepage to xml. Adding documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephanie Powell authored and Stephanie Powell committed Mar 18, 2009
1 parent 17e48df commit f3c68b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.markdown
@@ -1,3 +1,13 @@
= Spree Sitemaps
SUMMARY
=======

Sitemap management for spree.
This extension creates sitemaps in .html, .txt, and .xml (google sitemap) formats.

INSTALLATION
------------

1. Clone the git repo to SPREE_ROOT/vendor/extensions/sitemaps

git clone git://github.com/stephp/spree-sitemaps.git sitemaps

2. Sitemap is accessible at public_domain/sitemap.html, public_domain/sitemap.xml, and public_domain/sitemap.txt
6 changes: 6 additions & 0 deletions app/controllers/sitemap_controller.rb
Expand Up @@ -17,6 +17,12 @@ def _build_xml(nav, public_dir)
xml = Builder::XmlMarkup.new(:target => output, :indent => 2)
xml.instruct! :xml, :version => "1.0", :encoding => "UTF-9"
xml.urlset( :xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9" ) {
xml.url {
xml.loc public_dir
xml.lastmod Date.today
xml.changefreq 'daily'
xml.priority '1.0'
}
nav.each do |k, v|
xml.url {
xml.loc public_dir + v['link']
Expand Down

0 comments on commit f3c68b2

Please sign in to comment.