Configuring Web Feeds

RSS and Atom web feeds make it easy to stay notified about changes that happen on your site. Here's how to enable RSS and Atom feeds and facilitate their "autodiscovery".

First you'll enable web feeds, then you'll install a script that puts special links in your pages' HTML headers.

Enable Web Feeds

PmWiki comes with capability to provide web feeds based on RecentChanges pages. Feeds are easy to enable by un-commenting two lines in the pre-configured config.php configuration file.:

##  Enable RSS and Atom web feeds (?action=rss & ?action=atom).
##  Info: docs/sample-config.php | PmWiki.WebFeeds | Cookbok:FeedLinks
#
 if ($action == 'rss' || $action == 'atom') {
 include_once("$FarmD/scripts/feeds.php"); }

Install the FeedLinks Script

Your pages' HTML headers can include links to your web feeds. These links facilitate "autodiscovery" of the feeds.

To install the FeedLinks recipe you only need download a script and un-comment two more lines in the pre-configured config.php configuration file.

You can put the recipe's script in your cookbook/ directory from the command line like this:

#starting from the document root
cd site/cookbook
wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/feedlinks.php

Next un-comment two lines in the config.php file:

##  FeedLinks -- http://www.pmwiki.org/wiki/Cookbook/FeedLinks
##  Adds HTML header links that enable "autodiscovery" of the site's
##  Atom and/or RSS web feeds. (Enable RSS and/or Atom web feeds first.)
#
 $FeedLinkSourcePath = 'Main/AllRecentChanges';
 @include("$FarmD/cookbook/feedlinks.php");  # Site-wide

That's it. Now changes to your site will be easier to track.

Note

The CMS Mode recipe creates a special page at Main/AllRecentChanges that's ideal for web feeds. That changelog only includes pages you would want tracked by someone who's interested in the content on your site.

Page last modified on February 11, 2018, at 03:16 PM
Powered by: PmWiki and Quick Wiki CMS