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

Read More links in the RSS feed use relative URLs #590

Closed
arusahni opened this issue Aug 17, 2013 · 12 comments
Closed

Read More links in the RSS feed use relative URLs #590

arusahni opened this issue Aug 17, 2013 · 12 comments
Assignees
Labels

Comments

@arusahni
Copy link
Contributor

On my site I have RSS_TEASERS = True. The generated RSS is broken, however, as the generated "Read More" links use relative URLs. Sure enough, this fails the feed validator with the following warning:

description should not contain relative URL references: /blog/2012/01/implementing-custom-alert-dialogfragments.html (4 occurrences) [help]

@Kwpolska
Copy link
Member

From the docstring of post.Post.text():

    All links in the returned HTML will be relative.

Which is NEVER a good idea for RSS (and @ralsina does not want that function to differentiate between RSS and HTML.) (also, being the last person who bothered with those links, I am happy that it isn’t my fault.)

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

HI @arusahni can you give me a little more data?

  1. Where's your site ;-)
  2. What your settings are
  3. What the RSS links say
  4. What they should say

If it can't be fixed by tweaking the configuration, I'll fix it in the code, but I need a little hand to get there.

@ghost ghost assigned ralsina Aug 17, 2013
@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

@Kwpolska text() already munges the HTML too much, and has no idea where the resulting HTML will be used, which is necessary to use absolute links. So, the right place to fix those is at the plugin that actually generates the files, like the tag or rss plugins.

Perhaps those plugins need to indicate text() that / should be mapped to http://foo.com/bar, the target is /baz/bat and links made absolute with that information.

@arusahni
Copy link
Contributor Author

  1. http://arusahni.net
  2. Here's my conf.py. Note that I'm using FeedBurner. The direct link to Nikola's RSS feed is: http://arusahni.net/blog/rss.xml
  3. The RSS links are output as:
<a href="/blog/2012/01/implementing-custom-alert-dialogfragments.html">Read more...</a>

They should be:

<a href="http://arusahni.net/blog/2012/01/implementing-custom-alert-dialogfragments.html">Read more...</a>

HTH!

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

Just to be sure: the links work well if you subscribe to your feed directly without feedburner, right?

If yes, I think I know what's wrong and it's not horribly hard to fix :-)

@arusahni
Copy link
Contributor Author

No, they don't. I went to a web-based RSS reader and subscribed to the
feed directly. The 'Read More' link is relative there, as well, and
clicking it gets me a 404 on the reader's domain.

On Sat, Aug 17, 2013 at 4:02 PM, Roberto Alsina notifications@github.comwrote:

Just to be sure: the links work well if you subscribe to your feed
directly without feedburner, right?

If yes, I think I know what's wrong and it's not horribly hard to fix :-)


Reply to this email directly or view it on GitHubhttps://github.com/ralsina/nikola/issues/590#issuecomment-22818697
.

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

Well, it does work in feedspot and newsblur. But anyway, I have a solution for it, it's probably going to be in master in a day or two, once I find the least-intrusive way to do it.

@arusahni
Copy link
Contributor Author

I was using Digg Reader, FWIW. Here's the validator report.

Thanks for looking into this! I'll be turning RSS teasers off until then.

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

Well, RSS teasers is not the only thing that will break, links to other posts inside your HTML will break as well (but those are rather rare in general)

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

@arusahni I just pushed a branch to fix this, can you take a look? If you end up with absolute links that are wrong, then you may need to tweak BASE_URL

https://github.com/ralsina/nikola/pull/591

Let me know how it works!

@arusahni
Copy link
Contributor Author

That worked for me! I didn't have to set a BASE_URL, either.

@ralsina
Copy link
Member

ralsina commented Aug 17, 2013

On 17/08/13 17:48, Aru wrote:

That worked for me! I didn't have to set a |BASE_URL|, either.

Yes, that's only needed if your site is not deployed to your server's root.

I'll merge this then.

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

No branches or pull requests

3 participants