aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Taunt <bt@btxx.org>2024-07-22 10:14:29 -0400
committerBradley Taunt <bt@btxx.org>2024-07-22 10:14:29 -0400
commitd90c77fe3b001ea9157fea3b866220dde313211d (patch)
tree26d106dee0550453a0831f25719110e758b26dfd
parentd9f85954dc6f7a34444242d342fdf793e1d4681b (diff)
Fix dates in generated RSS feed
-rw-r--r--wruby.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/wruby.rb b/wruby.rb
index d891fbb..42e891b 100644
--- a/wruby.rb
+++ b/wruby.rb
@@ -61,7 +61,7 @@ def process_markdown_files(input_directory, output_directory, header_content, fo
header = replace_title_placeholder(header_content, title)
File.write(output_file, header + html_content + footer_content)
- items << { title: title, date: date, link: relative_path + '/', content: html_content }
+ items << { title: title, date: date.to_time.utc, link: relative_path + '/', content: html_content }
end
items
@@ -86,7 +86,7 @@ end
def generate_rss(posts, rss_file, author_name, site_name, site_url, posts_dir)
rss = RSS::Maker.make("atom") do |maker|
maker.channel.author = author_name
- maker.channel.updated = Time.now.to_s
+ maker.channel.updated = Time.now.utc.to_s
maker.channel.about = site_url
maker.channel.title = "#{site_name} RSS Feed"
@@ -94,7 +94,7 @@ def generate_rss(posts, rss_file, author_name, site_name, site_url, posts_dir)
maker.items.new_item do |item|
item.link = "#{site_url}/#{posts_dir}/#{post[:link]}"
item.title = post[:title]
- item.updated = post[:date].to_s
+ item.updated = post[:date].utc.to_s
item.content.type = 'html'
item.content.content = post[:content]
end