Addition of 'atom:link'

This commit is contained in:
NikaZhenya 2018-10-03 19:54:42 -05:00
parent b7d541e50b
commit 43eae2d70f
2 changed files with 7 additions and 2 deletions

View File

@ -116,6 +116,10 @@ def convert_xml file, hash, space = ''
hash.each do |k, v|
if k.to_s != 'items'
file.puts space + '<' + k.to_s + '>'
if k.to_s == 'channel'
file.puts space + ' <atom:link href="' + $site_link + '/feed/rss.xml" rel="self" type="application/rss+xml" />'
end
end
if v.class == Hash
@ -148,7 +152,7 @@ $rss[:channel][:lastBuildDate] = get_date($date, true)
$rss[:channel][:items].sort_by!{|h| h[:link]}.reverse!
xml = File.new('feed/rss.xml', 'w:UTF-8')
xml.puts '<?xml version="1.0" ?>'
xml.puts '<rss version="2.0">'
xml.puts '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">'
convert_xml(xml, $rss)
xml.puts '</rss>'
xml.close

View File

@ -1,6 +1,7 @@
<?xml version="1.0" ?>
<rss version="2.0">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="https://blog.cliteratu.re/feed/rss.xml" rel="self" type="application/rss+xml" />
<title>
Publishing is Coding: Change My Mind
</title>