]> iEval git - plack-app-gruntmaster.git/blame - lib/Gruntmaster/Page/Index.pm
Move header / footer to a separate module and update MANIFEST
[plack-app-gruntmaster.git] / lib / Gruntmaster / Page / Index.pm
CommitLineData
42546e6c
MG
1package Gruntmaster::Page::Index;
2
3use 5.014000;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7our @EXPORT_OK = qw/generate/;
8our $VERSION = '0.001';
9
10use constant TITLE => 'Gruntmaster 6000';
11
12use Fcntl qw/:flock/;
13use HTML::Template::Compiled;
14use IO::File;
832cb45e 15use Gruntmaster::Page::Common qw/header footer/;
42546e6c
MG
16
17my %templates = (
18 en => <<'HTML',
19HTML
20);
21
22$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates;
23$templates{$_} .= footer $_ for keys %templates;
24
25sub generate{
26 my $template = $templates{$_[1]};
27 my $htc = HTML::Template::Compiled->new(scalarref => \$template);
28 IO::File->new('>meta.yml')->close unless -f 'meta.yml';
29 flock my $metafh = IO::File->new('<meta.yml'), LOCK_SH;
30 $htc->output
31}
32
331
This page took 0.02469 seconds and 4 git commands to generate.