package Gruntmaster::Page::Index;

use 5.014000;
use strict;
use warnings;
use parent qw/Exporter/;
our @EXPORT_OK = qw/generate/;
our $VERSION = '0.001';

use constant TITLE => 'Gruntmaster 6000';

use Fcntl qw/:flock/;
use HTML::Template::Compiled;
use IO::File;
use Gruntmaster::Page qw/header footer/;

my %templates = (
  en => <<'HTML',
HTML
);

$templates{$_}  = header($_, TITLE) . $templates{$_} for keys %templates;
$templates{$_} .= footer $_ for keys %templates;

sub generate{
  my $template = $templates{$_[1]};
  my $htc = HTML::Template::Compiled->new(scalarref => \$template);
  IO::File->new('>meta.yml')->close unless -f 'meta.yml';
  flock my $metafh = IO::File->new('<meta.yml'), LOCK_SH;
  $htc->output
}

1
