use Path::Class;
use Template;
use YAML::XS 'LoadFile';
+
use Moose::Website::I18N;
+use Moose::Website::Resource::Templates;
+use Moose::Website::Resource::WebFiles;
our $VERSION = '0.01';
our $AUTHORITY = 'cpan:STEVAN';
required => 1,
);
+has 'locale' => (
+ is => 'ro',
+ isa => 'Str',
+ default => sub { 'en' },
+);
+
has 'page_file' => (
is => 'ro',
isa => 'Path::Class::File',
}
);
-has 'template_root' => (
- is => 'ro',
- isa => 'Path::Class::Dir',
- coerce => 1,
- default => sub {
- file(__FILE__)->parent->parent->parent->subdir('templates')
+# ....
+
+has 'template_resource' => (
+ traits => [ 'NoGetopt' ],
+ is => 'ro',
+ isa => 'Moose::Website::Resource::Templates',
+ lazy => 1,
+ default => sub {
+ Moose::Website::Resource::Templates->new
+ },
+ handles => {
+ 'template_root' => 'dir'
}
);
-has 'locale' => (
+has 'web_file_resource' => (
+ traits => [ 'NoGetopt' ],
is => 'ro',
- isa => 'Str',
- default => sub { 'en' },
+ isa => 'Moose::Website::Resource::WebFiles',
+ lazy => 1,
+ default => sub {
+ Moose::Website::Resource::WebFiles->new
+ },
);
-# ....
-
has 'i18n' => (
+ traits => [ 'NoGetopt' ],
is => 'ro',
isa => 'Object',
lazy => 1,
$outfile
) || confess $self->tt->error;
}
+
+ $self->log( "Copying web resources to " . $self->outdir );
+ $self->web_file_resource->copy( to => $self->outdir );
}
sub build_template_params {
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "global page title"
-msgstr "Moose - A Post Modern Object System for Perl"
-
msgid "moose"
msgstr "Moose"
msgid "presentations header"
msgstr "Presentations About Moose"
+# footer
+msgid "footer copyright"
+msgstr "Copyright © 2006 — 2010 Infinity Interactive"
-
+msgid "footer terms"
+msgstr "This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself."
--- /dev/null
+package Moose::Website::Resource::Templates;
+use Moose;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
+
+with 'Resource::Pack' => {
+ traits => [
+ 'Resource::Pack::Dir'
+ ]
+};
+
+__PACKAGE__->meta->make_immutable;
+
+no Moose; 1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Moose::Website::Resource::Templates - A Moosey solution to this problem
+
+=head1 SYNOPSIS
+
+ use Moose::Website::Resource::Templates;
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=over 4
+
+=item B<>
+
+=back
+
+=head1 BUGS
+
+All complex software has bugs lurking in it, and this module is no
+exception. If you find a bug please either email me, or add the bug
+to cpan-RT.
+
+=head1 AUTHOR
+
+Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2010 Infinity Interactive, Inc.
+
+L<http://www.iinteractive.com>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
<h2>[% loc('download header') %]</h2>
- <h3>[% loc('download cpan header') %]<h3>
+ <h3>[% loc('download cpan header') %]</h3>
- <p>[% loc('downlaod cpan body') %]<p>
+ <p>[% loc('download cpan body') %]</p>
<ul>
[% FOREACH module IN current_page.data.CPAN %]
[% END %]
</ul>
- <h3>[% loc('download git header') %]<h3>
+ <h3>[% loc('download git header') %]</h3>
- <p>[% loc('downlaod git body') %]<p>
+ <p>[% loc('download git body') %]</p>
<ul>
<li>[% loc('download git public') %] — [% current_page.data.git.public %]</li>
--- /dev/null
+[% WRAPPER 'wrapper/root.tt' %]
+ <h1 class="home">[% loc('moose') %]</h1>
+ <h2>[% loc('moose subtitle') %]</h2>
+ [% INCLUDE 'shared/nav.tt' %]
+ <div class="home_content">
+ <p>[% loc('about body') %]</p>
+ </div>
+ <br/>
+ <br/>
+ <div class="home_footer">
+ [% INCLUDE 'shared/footer.tt' %]
+ </div>
+[% END %]
\ No newline at end of file
--- /dev/null
+<p>[% loc('footer copyright') %]</p>
+<p>[% loc('footer terms') %]</p>
\ No newline at end of file
--- /dev/null
+<div class="nav">
+ <ul class="menu">
+ [% FOREACH page IN pages %]
+ [% IF page.name == current_page.name %]
+ <li class="active">[% loc('nav ' _ page.name) %]</li>
+ [% ELSE %]
+ <li class="inactive"><a href="[% page.outfile %]">[% loc('nav ' _ page.name) %]</a></li>
+ [% END %]
+ [% END %]
+ </ul>
+ <br class="clearfix" />
+</div>
\ No newline at end of file
--- /dev/null
+<html>
+<head>
+<title>[% loc('moose') %] - [% loc('moose subtitle') %]</title>
+<link rel="stylesheet" href="css/style.css" type="text/css">
+</head>
+<body>
+[% content %]
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+[% WRAPPER 'wrapper/root.tt' %]
+ <h1>[% loc('moose') %]</h1>
+ [% INCLUDE 'shared/nav.tt' %]
+ <div class="content">
+ [% content %]
+ </div>
+ <div class="footer">
+ [% INCLUDE 'shared/footer.tt' %]
+ </div>
+[% END %]
\ No newline at end of file
--- /dev/null
+package Moose::Website::Resource::WebFiles;
+use Moose;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
+
+with 'Resource::Pack' => {
+ traits => [
+ 'Resource::Pack::Dir'
+ ]
+};
+
+__PACKAGE__->meta->make_immutable;
+
+no Moose; 1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Moose::Website::Resource::WebFiles - A Moosey solution to this problem
+
+=head1 SYNOPSIS
+
+ use Moose::Website::Resource::WebFiles;
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=over 4
+
+=item B<>
+
+=back
+
+=head1 BUGS
+
+All complex software has bugs lurking in it, and this module is no
+exception. If you find a bug please either email me, or add the bug
+to cpan-RT.
+
+=head1 AUTHOR
+
+Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2010 Infinity Interactive, Inc.
+
+L<http://www.iinteractive.com>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
--- /dev/null
+
+BODY {
+ font-family : Ariel, Helvetica, sans-serif;
+ font-size : 10pt;
+ margin : 0px;
+ color : #666666;
+}
+
+h1 {
+ font-family : Arial Black;
+ font-size : 48pt;
+ margin : 0px;
+ line-height : 0.7em;
+ background : #336699;
+ color : #ffffff;
+ padding-left : 70px;
+ padding-top : 15px;
+}
+
+h1.home {
+ font-size : 72pt;
+ padding-top : 70px;
+}
+
+h2 {
+ font-size : 14pt;
+ margin : 0px;
+ line-height : 1em;
+ color : #336699;
+ padding-left : 75px;
+ padding-top : 25px;
+ padding-bottom : 20px;
+ background : #ffffff;
+ font-style : oblique;
+}
+
+.nav {
+ border-bottom : 1px solid #6699CC;
+ border-top : 10px solid #6699CC;
+}
+
+ul.menu {
+ padding-left : 70px;
+ margin-top : 0px;
+}
+
+ul.menu > li {
+ list-style-type : none;
+ float : left;
+ padding-left : 12px;
+ padding-right : 12px;
+ padding-top : 10px;
+ padding-bottom : 10px;
+ font-size : 1.2em;
+}
+
+ul.menu > li.active {
+ color : #003366;
+ background : #6699CC;
+}
+
+ul.menu > li.inactive {
+ color : #336699;
+}
+
+ul.menu > li a {
+ color : #336699;
+ text-decoration : none;
+}
+
+ul.menu > li a:hover {
+ color : #003366;
+ text-decoration : underline;
+}
+
+.content {
+ position : relative;
+ left : 75px;
+ padding-top : 20px;
+ width : 500px;
+}
+
+.content h2 {
+ font-size : 16pt;
+ line-height : 1em;
+ color : #336699;
+ padding : 0px;
+ margin-bottom : 10px;
+ background : #ffffff;
+}
+
+.content h3 {
+ font-size : 12pt;
+ margin : 0px;
+ color : #336699;
+ line-height : 1em;
+}
+
+.home_content {
+ position : relative;
+ left : 75px;
+ padding-top : 10px;
+ width : 500px;
+ font-size : 1.2em;
+}
+
+.home_footer {
+ position : relative;
+ left : 75px;
+ color : #aaaaaa;
+ font-size : 0.8em;
+ width : 500px;
+ border-top : 1px solid #aaaaaa;
+ padding-bottom : 40px;
+}
+
+.footer {
+ margin-top : 20px;
+ border-top : 1px solid #aaaaaa;
+ padding-left : 75px;
+ color : #aaaaaa;
+ font-size : 0.8em;
+ padding-bottom : 40px;
+}
+
+.clearfix {
+ clear: both;
+}
+
+
+++ /dev/null
-[% WRAPPER 'wrapper/root.tt' %]
-
- <h1>[% loc('moose') %]</h1>
- <h2>[% loc('moose subtitle') %]</h2>
- [% INCLUDE 'shared/nav.tt' %]
-
-[% END %]
\ No newline at end of file
+++ /dev/null
-<ul>
- [% FOREACH page IN pages %]
- <li><a href="[% page.outfile %]">[% loc('nav ' _ page.name) %]</a></li>
- [% END %]
-</ul>
\ No newline at end of file
+++ /dev/null
-<html>
-<head>
-<title>[% loc('global page title') %]</title>
-</head>
-<body>
-[% content %]
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-[% WRAPPER 'wrapper/root.tt' %]
-[% INCLUDE 'shared/nav.tt' %]
-[% content %]
-[% END %]
\ No newline at end of file