jipiboily / monologue

Monologue is a basic blogging engine. It is a Rails mountable engine you can mount in your already existing Rails app, or a in a new one! Enjoy.
http://jipiboily.com/2013/monologue-0-3-0-released-and-monologue-markdown
MIT License
477 stars 194 forks source link

Bug in RSS feed - root blog link #293

Open illegalnumbers opened 8 years ago

illegalnumbers commented 8 years ago

The root blog link takes from the site url (from the request? not sure) but the actual item creation in the RSS takes from the site_url.

Example, I have a local rails server and I get the following RSS feed:


<rss version="2.0">
  <channel>
    <title>Illegal Numbers</title>
    <description>Life. Code.</description>
    <link>http://localhost:3000/blog/</link>
    <item>
      <title>test</title>
      <description>&lt;p&gt;wysiwyg&lt;/p&gt;
</description>
      <pubDate>Thu, 03 Nov 2016 00:00:00 +0000</pubDate>
      <link>http://www.illegalnumbers.com/blog/2016/test</link>
      <guid>http://www.illegalnumbers.com/blog/2016/test</guid>
    </item>
  </channel>
</rss>```
jipiboily commented 8 years ago

Ah, interesting.

Any chance you can send a PR fixing that?

illegalnumbers commented 8 years ago

I can tinker with it when I get a chance!

illegalnumbers commented 8 years ago

So if the rss file that gets copied over is the same one used in the engine this

xml.instruct! :xml, version: "1.0"
xml.rss version: "2.0" do
  xml.channel do
    xml.title Monologue::Config.site_name
    xml.description Monologue::Config.meta_description
    xml.link root_url

    for post in @posts
      xml.item do
        xml.title post.title
        xml.description raw(post.content)
        xml.pubDate post.published_at.to_s(:rfc822)
        xml.link Monologue::Config.site_url + post.full_url
        xml.guid Monologue::Config.site_url + post.full_url
      end
    end
  end
end

Would need to change the xml.link to root_url for everything or change it to Monologue::Config.site_url for everything. Either way would stay consistent, but if I patch it I'll probably do the site_url way.

jipiboily commented 8 years ago

Yup, sounds good to me, thanks @illegalnumbers!