_plugins/generate_sitemap.rb
def generate_content(site)
      result   = ''

      #Add first pages
      result += entry("/", Time.new, "daily", site, "1.0")
      # result += entry("/#{Time.new.year}/#{Time.new.month}/",  Time.new, "weekly", site, "1.0")




      # Next, find all the posts.
      posts = site.site_payload['site']['posts']

      for post in posts do
        unless post.data['draft']
          if post.data.has_key?('changefreq')
            changefreq = post.data["changefreq"]
          else
            changefreq = "never"
          end
          url = post.url
          url = url[0..-11] if url=~/\/index.html$/
          result += entry(url, post.date, changefreq, site, "0.9")
        end
      end

        result
    end
# Returns a string containing the the XML entries.
#
#  +site+ is the global Site object.
Returns a string containing the the XML entries.
+site+ is the global Site object.
Returns a string containing the the XML entries . + site + is the global Site object .
def generate_content(site)
      result   = ''
      result += entry("/", Time.new, "daily", site, "1.0")
      posts = site.site_payload['site']['posts']
      for post in posts do
        unless post.data['draft']
          if post.data.has_key?('changefreq')
            changefreq = post.data["changefreq"]
          else
            changefreq = "never"
          end
          url = post.url
          url = url[0..-11] if url=~/\/index.html$/
          result += entry(url, post.date, changefreq, site, "0.9")
        end
      end
        result
    end
def generate_content ( site ) result = '' result += entry ( "/" , Time . new , "daily" , site , "1.0" ) posts = site . site_payload [ 'site' ] [ 'posts' ] for post in posts do unless post . data [ 'draft' ] if post . data . has_key? ( 'changefreq' ) changefreq = post . data [ "changefreq" ] else changefreq = "never" end url = post . url url = url [ 0 .. - 11 ] if url =~ / \/ index.html$ / result += entry ( url , post . date , changefreq , site , "0.9" ) end end result end
Returns a string containing the the XML entries.
Returns a string containing the the XML entries .
#Add first pages # result += entry("/#{Time.new.year}/#{Time.new.month}/",  Time.new, "weekly", site, "1.0") # Next, find all the posts.
site