Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in RSS feed - root blog link #293

Open
illegalnumbers opened this issue Nov 8, 2016 · 4 comments
Open

Bug in RSS feed - root blog link #293

illegalnumbers opened this issue Nov 8, 2016 · 4 comments

Comments

@illegalnumbers
Copy link
Contributor

illegalnumbers commented Nov 8, 2016

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
Copy link
Owner

Ah, interesting.

Any chance you can send a PR fixing that?

@illegalnumbers
Copy link
Contributor Author

I can tinker with it when I get a chance!

@illegalnumbers
Copy link
Contributor Author

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
Copy link
Owner

Yup, sounds good to me, thanks @illegalnumbers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants