diff options
author | Bradley Taunt <bt@btxx.org> | 2024-07-22 13:04:30 -0400 |
---|---|---|
committer | Bradley Taunt <bt@btxx.org> | 2024-07-22 13:04:30 -0400 |
commit | e7794c42cf99dfd9457da2f05b15c46ec1cf5d76 (patch) | |
tree | 577a3fa3bbb634ff9fd16d217b14de993339c1e3 | |
parent | c4e1469f2f184f94a7ed7d1693010bc52d3133b1 (diff) |
Default to RSS 2.0 instead of Atom
-rw-r--r-- | footer.html | 2 | ||||
-rw-r--r-- | index.md | 2 | ||||
-rw-r--r-- | wruby.rb | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/footer.html b/footer.html index d1747b7..f2d568a 100644 --- a/footer.html +++ b/footer.html @@ -6,7 +6,7 @@ <li><a href="/">Home</a></li> <li><a href="/about">About</a></li> <li><a href="/websites">Websites</a></li> - <li><a href="/index.atom">RSS</a></li> + <li><a href="/index.rss">RSS</a></li> <li><a href="#top">↑ Top of the page</a></li> </ul> <small> @@ -7,7 +7,7 @@ The "w" is silent... ## Features * Fast, OS-agnostic site generator -* Auto-generated, valid [Atom feed](/index.atom) +* Auto-generated, valid [RSS feed](/index.rss) * Custom `header.html` and `footer.html` templates * Not much else (this is a *good* thing!) @@ -20,7 +20,7 @@ pages_output_dir = "#{output_dir}/" header_file = 'header.html' footer_file = 'footer.html' root_index_file = 'index.md' -rss_file = "#{output_dir}/index.atom" +rss_file = "#{output_dir}/index.rss" # Make sure output directories exist [posts_output_dir, pages_output_dir].each { |dir| FileUtils.mkdir_p(dir) } @@ -83,21 +83,21 @@ def generate_index(posts, header_content, footer_content, root_index_file, outpu end # Generate the RSS feed -# Generate the RSS feed def generate_rss(posts, rss_file, author_name, site_name, site_url, posts_dir) - rss = RSS::Maker.make("atom") do |maker| + rss = RSS::Maker.make("2.0") do |maker| maker.channel.author = author_name maker.channel.updated = Time.now.utc.to_s - maker.channel.about = site_url maker.channel.title = "#{site_name} RSS Feed" + maker.channel.description = "The official RSS Feed for #{site_url}" + maker.channel.link = site_url posts.each do |post| maker.items.new_item do |item| item.link = "#{site_url}/#{posts_dir}/#{post[:link]}" item.title = post[:title] item.updated = post[:date].utc.to_s - item.content.type = 'html' - item.content.content = post[:content] + item.published = post[:date].utc.to_s + item.content_encoded = post[:content] end end end |