Permalink
Browse files

Document the Publication and Compass plugins.

  • Loading branch information...
mdub committed Oct 31, 2012
1 parent 82dd823 commit 3317479fc0d988fc247df2e4549b305f55d252d6
Showing with 46 additions and 0 deletions.
  1. +46 −0 README.markdown
View
@@ -214,6 +214,52 @@ For even quicker prototyping, Pith includes a simple HTTP server. Start it by u
Pith will incrementally re-build the site as you browse -- that is, if you alter any input files, Pith will regenerate the affected outputs.
+Plugins
+-------
+
+Pith includes a couple of optional "plugins". Actually, "plugin" is a bit strong: they're just plain old Ruby modules that extend Pith's functionality.
+
+### Publication plugin
+
+The 'publication' plugin makes it easier to build a weblog using Pith.
+
+Enable it by requiring it in your "`config.rb`", like so:
+
+ require "pith/plugins/publication"
+
+Now you can specify a "published" date/time in the metadata of any pages you consider to be "articles", e.g.
+
+ ---
+ title: Introducing ShamRack
+ published: 3-July-2009, 15:50
+ ...
+
+This exposes "`page.published_at`" for use in your templates.
+
+In addition, "`project.published_inputs`" lists all the pages that have such a timestamp, in order of publication, making it easy to build index pages and XML feeds. Here's a example, used to build the article index for [dogbiscuit.org](http://dogbiscuit.org/mdub/weblog):
+
+ %ul.articles
+ - project.published_inputs.reverse.each do |entry|
+ %li
+ %p
+ = link(entry)
+ %span.teaser
+ %span.published_at
+ on
+ = entry.published_at.strftime("%e %b, %Y")
+
+### Compass plugin
+
+The Compass plugin gives you the full power of [Compass][compass] in your Sass stylesheets. Enable it by requiring it in your "`config.rb`":
+
+ require "pith/plugins/compass"
+
+Note that if you're using Bundler, you'll also need to include the Compass gem in your `Gemfile`.
+
+ gem "compass"
+
[tilt]: http://github.com/rtomayko/tilt/
[haml]: http://haml-lang.com
[sass]: http://sass-lang.com
+[compass]: http://compass-style.org
+

0 comments on commit 3317479

Please sign in to comment.