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

Wrong img src url in rss #1162

Closed
tiagovaz opened this issue Mar 23, 2014 · 8 comments · Fixed by #1172
Closed

Wrong img src url in rss #1162

tiagovaz opened this issue Mar 23, 2014 · 8 comments · Fixed by #1172

Comments

@tiagovaz
Copy link

Hi,

I'm hosting a nikola instance at http://acaia.ca/~tiago/. The generated RSS is removing the "/~tiago/" part from image sources, so I get many broken links in a feed reader.

Example: img alt="/images/umapper.png" src="http://acaia.ca/images/umapper.png"

It should be img alt="/images/umapper.png" src="http://acaia.ca/~tiago/images/umapper.png"

The config file is correct and the HTML is also generated correctly. I'm not sure if it's an issue with PyRSS2Gen or with nikola itself. Please let me know if you need further information.

Regards,

@ralsina
Copy link
Member

ralsina commented Mar 23, 2014

What's your version of Nikola, and what's in your BASE_URL setting?

@tiagovaz
Copy link
Author

Nikola v6.4.0
BASE_URL is not set.
SITE_URL = "http://acaia.ca/~tiago/"

@ralsina
Copy link
Member

ralsina commented Mar 23, 2014

I'd have to check, to be honest. Can you put a dump of the site somewhere private and mail me the URL at ralsina (at) kde org?

@Kwpolska
Copy link
Member

I think I found the issue.

In the mentioned post:

.. figure:: /images/umapper.png

    Umapper (from http://sourceforge.net/projects/umapper)

Nikola tries to be intelligent here, and makes those paths relative to /~tiago/. However, the dates in RSS are not treated this way, and they are still relative to /, as the URL would suggest.

We should probably find this “intelligence” bit and (a) nuke it, or (b) extend it to RSS.

@ralsina
Copy link
Member

ralsina commented Mar 26, 2014

@tiagovaz I meant a dump of the sources and config of your site, not the output :-)

But I see, the images links are different in the RSS.

I have reproduced this.

@ralsina
Copy link
Member

ralsina commented Mar 26, 2014

The problem seems to be in Post.text(), where document.make_links_absolute is removing the path, so the image ends up hanging from the root of the site instead of ~tiago

Why that doesn't happen with the actual post page is troubling.

ralsina added a commit that referenced this issue Mar 26, 2014
@ralsina
Copy link
Member

ralsina commented Mar 26, 2014

@tiagovaz I have a fix, but it probably can't apply cleanly to 6.4.0... in the meantime, I see you made it work by hacking your webserver.

@ralsina ralsina mentioned this issue Mar 26, 2014
@tiagovaz
Copy link
Author

hey, thanks for the fix, hope it can be pushed to a next release. And yes, I've just linked image dirs to my www_root. (ps: sorry for the wrong tarball :)

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

Successfully merging a pull request may close this issue.

3 participants