#################### 1: ttreerc #################### recurse verbose src = src dest = dest lib = lib copy = \.(gif|jpg|png|css)$ ignore = ~$ post_chomp 1 preprocess = data preprocess = templates process = process #################### 2: lib/data #################### [% venues = { cheerful = { name = "The Cheerful Sports Page" } harmony = { name = "The Harmony Inn" } hot = { name = "The Hot Seat Bar and Grill" } jimmy = { name = "Jimmy's Sports Bar" } jo = { name = "Jo's Saloon" } johns = { name = "Dr. Johns Pub" } kenzie = { name = "McKenzie Pub" } lair = { name = "Pete's Lair" } sneakers = { name = "Sneakers Pub" } wong = { name = "Wong's Chinese Restaurant" } }; djs = { adam = { name = "Adam" } brian = { name = "Brian" } chad = { name = "Chad" } jake = { name = "Jake" } jd = { name = "J.D." } melissa = { name = "Melissa" } rc = { name = "RC" } sean = { name = "Sean" } shannon = { name = "Shannon" } starr = { name = "Starr" } }; shows = [ ["Monday" { venue = "sneakers" notes = "Starts right after the game!" } ] ["Tuesday" { venue = "hot" dj = "adam" } { venue = "lair" dj = "brian" } { venue = "cheerful" dj = "starr" } { venue = "johns" dj = "rc" } ] ["Wednesday" { venue = "hot" dj = "jd" } { venue = "jimmy" dj = "brian" } { venue = "cheerful" dj = "shannon" } { venue = "jo" dj = "rc" } { venue = "johns" dj = "sean" } ] ["Thursday" { venue = "hot" dj = "shannon" } { venue = "cheerful" } { venue = "kenzie" } { venue = "jo" dj = "rc" } ] ["Friday" { venue = "hot" dj = "adam" } { venue = "lair" dj = "melissa" } { venue = "johns" dj = "rc" } { venue = "cheerful" dj = "jake" } { venue = "harmony" dj = "starr" } { venue = "jo" dj = "chad" } { venue = "wong" dj = "jd" notes = "Big cash prizes!" } ] ["Saturday" { venue = "hot" dj = "jd" } { venue = "harmony" dj = "shannon" } { venue = "cheerful" } { venue = "jimmy" } { venue = "wong" } ] ]; %] #################### 3: lib/templates #################### [% BLOCK djlink; # dj = "dj short id" # prefix = "../dj/" or "dj/" or "" %] [% djs.$dj.name %] [%- END %] [%##################################### %] [% BLOCK venuelink; # venue = "venue short id" # prefix = "../venue/" or "venue/" or "" %] [% venues.$venue.name %] [%- END %] [%##################################### %] [% BLOCK djwrapper; # dj = "dj short id" djname = djs.$dj.name; %]

[% djname | html %]

[% content %]

Where is [% djname %]?

[% djname | html %] can be seen at: [% END %] [%##################################### %] [% BLOCK venuewrapper; # venue = "venue short id" venuename = venues.$venue.name; %]

[% venuename | html %]

[% content %]

What's happening at [% venuename | html %]?

[% venuename | html %] is the place to be on: [% END %] #################### 4: lib/process #################### [% content = PROCESS $template %] [% template.title or "The Music Guy Karaoke" %] [% content %] #################### 5: src/index.html ####################

Welcome to Karaoke!

Our show line-up

[% FOR day IN shows; dayname = day.0; %]

[% dayname %]

[% FOR show IN day.slice(1); venue = show.venue; "\n" IF loop.last; END; %] [% END %] #################### 6: src/dj/index.html ####################

Check out our DJs!

[% FOR dj IN djs.keys.sort("name") %] [% "\n" IF loop.last %] [% END %] #################### 7: src/dj/jd.html #################### [% WRAPPER djwrapper dj = "jd" %] Yes, the man that is "dj" spelled backwards! [% END %] #################### 8: src/venue/index.html ####################

Check out our venues!

[% FOR venue IN venues.keys.sort("name") %] [% "\n" IF loop.last %] [% END %] #################### 9: src/venue/hot.html #################### [% WRAPPER venuewrapper venue = "hot" %] Check out our daily drink special! [% END %]