Skip to content

Integrated services

avdgaag edited this page Jan 19, 2011 · 1 revision

The template helps setting up commonly used external services:

  • feedburner
  • google analytics
  • google webmaster tools, bing webmaster tools

Feedburner

Feedburner is a proxy for your feed, that helps you collect stats on your RSS subscribers. You point FeedBurner at your own RSS URL, and your visitors at the FeedBurner URL.

FeedBurner works well enough on its own, but handing out somebody else's URL for your content is not a good idea -- you can keep it yourself by using a simple HTTP redirect.

  1. publish your feed at http://yoursite.com/atom.xml
  2. point Feedburner at that feed.
  3. create a HTTP redirect from http://yoursite.com/feed to http://feeds.feedburner.com/yoursite
  4. link to http://yoursite.com/feed on your site.

You could also use user agent sniffing to detect the feedburner bot, but I think this is the simplest setup.

The template automatically generates the redirects for you by using Erb in the .htaccess file, if you fill in the details in the config.yaml:

feed_url: "/feed"
feedburner_url: "http://feeds.feedburner.com/MyFeed"

Google Analytis

Google Analytics can be used to track your site analytics by simply entering your tracking ID in your config.yaml:

meta_data:
  ga_tracking_code: "XXX"

When this value has been set, the tracking snippet will be automatically included in the default layout.

Google Webmaster Tools (and others)

Site verification

You can use Google Webmaster tools for some further technical diagnostics. To do so, you need to verify your ownership of the site. Google offers various options, but uploading a unique file to your server is the simplest.

Google will give you a file with a unique name and content. You can enter the name and content in your config.yaml and nanoc will generate the required files for you. As such, you can create multiple such files, for example for use with Yahoo! or Bing webmaster tools.

Of course, you could also just create the file in your content directory, but I don't like how this essentially meta-information clutters the content list. I therefore opted to use the nanoc preprocessor to generate these files on compilation.

Example:

webmaster_tools:
  -
    identifier: "google12345" # the nanoc identifier for this item
    content: "some content goes here"
    extension: "html" # Bing uses xml

XML sitemaps

On a side note, there is also a default setup for generating a sitemap.xml file using nanoc's built-in xml_sitemap function. By default all content files are included, except for the ones you explpicitly hide using a is_hidden: true attribute.

The template then provides a rake task to ping Google about your updated sitemap. When you hook this task up to your publish task, you can automatically tell Google when you update your site. Use rake -T to get a list of all available tasks.

Clone this wiki locally