Skip to content

Instantly share code, notes, and snippets.

@KamilaBorowska
Created September 12, 2012 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KamilaBorowska/3708613 to your computer and use it in GitHub Desktop.
Save KamilaBorowska/3708613 to your computer and use it in GitHub Desktop.
use Bailador;
Bailador::import;
get /^\/(<-[/]>*)\/edit$/ => sub ($name) {
template 'edit.tt', $name;
}
get /^\/(<-[/]>*)$/ => sub ($name is copy) {
$name ||= 'Main page';
try {
CATCH {
template 'error.tt', "$name doesn't exist!";
}
my $content = slurp "content/$name";
template 'index.tt', $name, $content;
}
}
baile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment