From c7d5365f81552cae16bbb91696ca3e67b4a0a2e9 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 15 May 2011 18:33:00 -0400 Subject: major refactoring, improved file watching, changed site to public to support rack via pow (http://pow.cx) also implemented the basics of a 320 and up design refresh on the classic theme. This should make it great for mobile reading --- _plugins/generate_sitemap.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to '_plugins/generate_sitemap.rb') diff --git a/_plugins/generate_sitemap.rb b/_plugins/generate_sitemap.rb index 488a992b..4d580c47 100644 --- a/_plugins/generate_sitemap.rb +++ b/_plugins/generate_sitemap.rb @@ -44,7 +44,6 @@ module Jekyll priority :low # Domain that you are generating the sitemap for - update this to match your site. - BASE_URL = 'http://recursive-design.com' # Generates the sitemap.xml file. # @@ -82,6 +81,8 @@ module Jekyll def generate_content(site) result = '' + base_url = site.config['url'] + # First, try to find any stand-alone pages. site.pages.each{ |page| path = page.subfolder + '/' + page.name @@ -93,14 +94,14 @@ module Jekyll end unless path =~/error/ - result += entry(path, mod_date) + result += entry(base_url, path, mod_date) end } # Next, find all the posts. posts = site.site_payload['site']['posts'] for post in posts do - result += entry(post.id, post.date) + result += entry(base_url, post.id, post.date) end result @@ -115,12 +116,12 @@ module Jekyll # # +path+ is the URL path to the page. # +date+ is the date the file was modified (in the case of regular pages), or published (for blog posts). - def entry(path, date) + def entry(base_url, path, date) # Force extensions to .html from markdown, textile. path = path.gsub(/\.(markdown|textile)$/i, '.html') " - #{BASE_URL}#{path} + #{base_url}#{path} #{date.strftime("%Y-%m-%d")} " end -- cgit v1.2.1