You are here: Browse Railsplugins Mephisto Section Feeds
= MephistoSectionFeeds
Provides a liquid filter that returns a feed url for the current section of the site, or a default feed url if there is no current section (where current section is defined by @context[‘site’].current_section).
This plugin was created primarily to give an easy way to produce dynamic URL’s for feedburner feeds, but also works well with no additional configuration if you just want to be able to dynamically specify a different feed URL for each section.
Usage
At it’s simplest:
section | section_feed_url
Auto-Discovery Link:
<link href="{{ section | section_feed_url }}" title="Atom" rel="service.feed" type="application/atom+xml" />
MephistoPlugins::SectionFeed.feeds
located in section_feed.rb
If your section feeds are provided by Mephisto and are a default configuration, you can happily ignore @@feeds and the section_feed_url filter will always provide a correct path for the feed for the current section.
If your section feeds are not provided(or hosted) by Mephisto or if you wish to customize your feed URL’s for some other purpose, the @@feeds module attribute accessor is provided for this use.
@feeds is a hash which is keyed on Section.path. It's values should return the uri your feed is located at. The @feeds hash must also set a default value ala:
@@feeds.default = "http://feedburner.com/mysite-section"
An example hash in a site with sections named “foo”, “bar” and “baz” might look like:
@@feeds = {
'foo' => 'http://feeds.feedburner.com/mysite-foo',
'bar' => 'http://feeds.feedburner.com/mysite-bar',
'baz' => 'http://feeds.feedburner.com/mysite-baz'
}
@@feeds.default = 'http://feedburner.com/mysite'
Any valid hash with a default will do though. The default allows you to call unrepresented sections without fear, as they’ll just return the default feed url… And of course, if you just want to let Mephisto handle all of your section feeds internally, there’s never any need for configuration at all.
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly