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

Feed link inside feed should use FEED_DOMAIN #290

Merged
merged 2 commits into from
Apr 1, 2012

Conversation

justinmayer
Copy link
Member

The initial work on enabling feeds to be served from a different domain
than the site domain focused on the feed link displayed inside the
base template. But there is also a feed link inside the generated feed
itself, which this commit updates to use the FEED_DOMAIN value (if
defined).

Also, it turns out that the FEED_MAIN_URL setting is not necessary; the
existing FEED and FEED_RSS functionality is simpler and can address the
targeted use case just as easily. That attribute has been removed from
the settings and template, along with corresponding changes to the docs.
Refs #177.

The initial work on enabling feeds to be served from a different domain
than the site domain focused on the feed link displayed inside the
base template. But there is also a feed link inside the generated feed
itself, which this commit updates to use the FEED_DOMAIN value (if
defined).

Also, it turns out that the FEED_MAIN_URL setting is not necessary; the
existing FEED and FEED_RSS functionality is simpler and can address the
targeted use case just as easily. That attribute has been removed from
the settings and template, along with corresponding changes to the docs.
Refs getpelican#177.
The ID of a feed entry should never change, but the previous method of
generating the ID -- i.e., using the entry URL -- results in an ID that
is not permanent and can change. Switching to the tag URI method from
RFC 4151 should help improve the long-term uniqueness and permanence of
entry IDs, as espoused here:
<http://web.archive.org/web/20110514113830/http://diveintomark.org/archives/2004/05/28/howto-atom-id>

Also added a trailing slash to the site URL inside the feed; the lack
thereof was causing a feed validation warning.
almet added a commit that referenced this pull request Apr 1, 2012
Feed link inside feed should use FEED_DOMAIN
@almet almet merged commit 0993458 into getpelican:master Apr 1, 2012
@saimn
Copy link
Contributor

saimn commented Apr 2, 2012

I'm not sure but if I understand well this new behaviour, I must change my feedburner address from http://feeds.feedburner.com/MySite to http://feeds.feedburner.com/MySite/main.xml, which I do no want.
Imho, the previous behaviour with FEED_MAIN_URL was simpler and easier to understand. Now I don't know how to use it and if it will break my feed if I change my "Feed Address" to MySite/main.xml.

@justinmayer
Copy link
Member Author

I certainly understand your consternation. I will do my best to explain how to configure things such that there should be no disruption for you.

First, it's important to understand that there was a problem with the previous behavior: the value defined in the FEED_MAIN_URL setting was honored in the template but not inside the generated feed. If you look inside your generated main feed file, you will probably see something like <link href="http://feeds.feedburner.com/feeds/all.atom.xml" rel="self">, which clearly is not correct if your canonical feed URL is supposed to be http://feeds.feedburner.com/MySite. I explained the reason behind this in a comment in issue #225, but the crux of the cause is that the current feed generation logic assumes that the feed URL and the file written to the filesystem both follow the exact same pattern. So if your feed URL ends in /MySite, then the generated file must also be named MySite and exist at the web root.

In your case, I suggest setting your FEED value to MySite, which will ensure that your feed links are correct and the file saved at the correct location (web root). In FeedBurner, set your "Feed Address" to http://www.yourdomain.com/MySite.

Of course, in this case the feed file will be written to the web root instead of (web_root)/feeds/, so it's not as tidy at the filesystem level. But that's a minor consideration given that at least your feed links will function correctly. If (like me) your OCD tendencies insist that you not have the MySite feed file cluttering up your web root, you can write a wrapper script around the pelican command to automatically move your main feed file into (web_root)/feeds/ after generation. This assumes, of course, that you either (a) set your "Feed Address" in FeedBurner to http://www.yourdomain.com/feeds/MySite or (b) configure your web server to rewrite requests for http://www.yourdomain.com/MySite to http://www.yourdomain.com/feeds/MySite.

Hopefully this has been helpful and has not simply resulted in muddying the waters further. Please let me know if I can be of any further assistance. :^)

@saimn
Copy link
Contributor

saimn commented Apr 2, 2012

thanks for the detailed answer, I understand the issue and will try your solution.

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 this pull request may close these issues.

3 participants