|
[Previous entry: "success!"] [Main Index] [Next entry: "discoveries"]
05/19/2005: "GM RSS"
This entry will be all about getting the GreyMatter blog tool to spit out valid RSS, the reigning data syndication format. GreyMatter doesn't do RSS by default. Let's tell it to start.
I won't go into detail about RSS but it's very cool. People can use desktop programs, websites like Bloglines (my personal fave), or even Livejournal to read your entries every time you update your website.
This method of GM RSS uses a "connected file" -- a file that you upload to your site and tell GreyMatter to process and update. In order for the RSS feed to be updated automatically once you have this set up, connected files must be set to be rebuilt every time you update your GM site, or else you'll have to rebuild the connected files by hand. If you already use connected files for "About Me" pages, you may not want GreyMatter to rebuild each static file every time you add an entry. I would suggest disconnecting those files. Just temporarily reconnect them if you update your template, rebuild, and disconnect again -- it'll save server processing.
My template uses RSS 2.0 as that is what I know best. (I have kept an RSS feed for one of my sites, by hand, for something like nine months at least now.) I also assume a single-author GM site, since that's what I'm most familiar with. If your site has multiple authors, you probably want to replace any instances of {{author}} with something like Site.com update team.
I'm going to go through two ways to do this: the "just give me an RSS feed already!" quickstart, then the "let me configure every detail" tweaking. Let's get going!
GM RSS Quickstart
- Save this file to your hard drive as rss.xml (or index.xml or index.rss if your server correctly handles the .rss extention. This walkthrough assumes you use rss.xml for simplicity's sake).
- Upload it to your root web directory (usually this is public_html) and CHMOD it to 666.
- Go into your GreyMatter control panel (usually yoursite.com/cgi-bin/gm.cgi), enter the Configuration section, and scroll down to Connect Other Files. Add the line ../public_html/rss.xml in the box (or whatever the correct path is to rss.xml relative to gm.cgi ) and mark "Update them when adding entries?" as Yes.
- Update as usual and your RSS feed updates with you. You'll want to add a link to your template advertising your new feed so people know it's there and use it.
Configuring your RSS feed
This more detailed RSS template is an example of the settings you can add to your feed. Most of them are better covered by various RSS references so I won't go into detail. I have not used these settings on the simple template I gave above because they may cause problems -- for instance, if someone writes a Chinese blog but uses an RSS feed that claims it is English, that just ain't good.
The RSS 2.0 spec has a great rundown of all the settings you can add to your feed. I quite recommend it. (Yeah, mostly I'm just lazy at this point. Sue me. It's still morning and I'm writing this crap instead of drinking my beloved caffeine.)
Edits
6/14/2005: I've updated my RSS feed with this tutorial. We're up to two real entries in the feed and a third pointing to the archives. Woot.
|
nav
Want your Greymatter install to have an RSS feed, too? Here's how I got mine going, and a template you can use to make yours.
|