fifthposition edited this page Jun 19, 2011 · 10 revisions

Home; Being, a Number of explanatory Comments Regarding the Nature of the Project in Question.

This is

Rizzo is a Groovy script for static site generation.

It works by

All actual work is currently done in the script. In the example site, rizzo.groovy lives in the same directory as the source for the generated site, but because the script requires both source (where the site's data is) and destination (where to place the generated site) directories, it could in theory be run from anywhere.

The site source should have the following five directories (all of which are present in the example site):

  • css
  • images
  • pages
  • posts
  • templates

...and the two files meta.groovy (maintained by the script & currently storing only the date of last publish) and site-config.groovy (which holds such bits as the site's URL and name, and the author's name).

When you run it from the command line, as (for example):

groovy rizzo -s /Users/ebenezer/site-source/ -d /Users/ebenezer/site-published/

Rizzo will start by generating each page that is marked as updated since the last publish date (or, if the site has never yet been published, all pages). It will do the same for posts, and then it will copy all files in the css and images directories to the destination directory, unmodified.

Posts can have tags, and for each post, Rizzo will add each tag that is used to its list of the site's tags. After the post generation is done, each tag gets an archive page listing every post that uses it. Rizzo will also generate a page listing all of the site's tags (with a post count by each).

Templates

There are six templates:

  • home (the home page's header and footer)
  • home_mid (the HTML added to the content of the home page, used for each post listed there)
  • page (used for pages)
  • post (used for posts)
  • feed (used for the Atom feeds)
  • entry (the XML added to the body of each feed per entry)

Posts

Posts are stored as .html files in the posts directory. The first five lines of a post are metadata. This is not stored as any form of markup or code; the metadata is in plain text. The only constraints for a post's metadata are those for the dates (which currently must be of the form "MM-dd-yyyy h:mm a") and those for tags, which are written as simple comma-separated lists. The sixth line is left blank; all text after the sixth line is counted as the body of the post.

For an example of the metadata for a typical post, see one of the posts in the example site.

The metadata is pulled from a post's .html file as shown below.

  1. The Title Of The Post
  2. Date created
  3. Date last updated (for a new post, these dates should be the same)
  4. Tags, if any (if none, this line should be left blank)
  5. The (short) summary to be used in the Atom feed; this is currently required, but it should not be, and I hope to soon make this optional

Pages

Pages work in much the same manner as posts; they are saved as .html files in the pages directory, and they have two lines of metadata. These are:

  1. The Title Of The Page
  2. Date last updated

After these two lines, as with posts, there is a blank third line. Everything after the third line counts as the page body.

Filenames and URLs

The filename of either a post or a page is used in the final URL. If a post or a page has the filename this-is-a-title.html, the final site will have either a post at /archives/this-is-a-title.html or a page at /this-is-a-title.html.

Feeds

Right now Rizzo generates a site-wide feed (with the last 20 posts) and a feed for each individual tag. The main feed is, in the example site, linked to from the home page. The tag feeds should be likewise linked to from the tag pages, and will in fact be so in future (when I get around to it).

It needs

This entire deal needs an entirely enormous amount of work, which I hope to get to sometime in the near to farther future. There are extremely few (currently 0) guarantees regarding the addition of additional functionality, etc. If however anyone other than yours truly has any interest in furthering the cause of static publishing as Groovy knows it, I will in no way be at all angry about it.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.