From: Stevan Little Date: Sun, 28 Mar 2010 17:45:18 +0000 (-0400) Subject: more stuff X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5efab74a699ef461c67056c4accb5056eabdb9bf;p=gitmo%2Fmoose-website.git more stuff --- diff --git a/data/pages.yml b/data/pages.yml index 04b14c0..cdb6454 100644 --- a/data/pages.yml +++ b/data/pages.yml @@ -5,6 +5,66 @@ - name : about template : about.tt outfile : about.html + data : + companies: + - name : "Yahoo!" + url : http://www.yahoo.com + - name : "Symatec" + url : http://www.symatec.com + - name : "Cisco" + url : http://www.cisco.com + - name : "IMDb" + url : http://www.imdb.com + - name : "Pobox" + url : http://www.pobox.com + - name : "Best Practical" + url : http://www.bestpractical.com + - name : "Infinity Interactive" + url : http://www.iinteractive.com + - name : "Shadowcat" + url : http://www.shadowcat.co.uk + - name : "ValueClick" + url : http://www.valueclick.com + - name : "Magazines.com" + url : http://www.magazines.com + - name : "Takkle.com" + url : http://www.takkle.com + - name : "BBC" + url : http://www.bbc.co.uk + - name : "Hearst Corporation" + url : '' + - name : "Omni Hotels" + url : http://www.omnihotels.com + - name : "SocialText" + url : http://www.socialtext.com + - name : "Napster" + url : '' + - name : "Open Data" + url : '' + - name : "Capitol Advantage" + url : '' + - name : "Tamarou" + url : http://www.tamarou.com + - name : "Cloudtone Studios" + url : '' + - name : "Endeworks" + url : '' + - name : "net-a-porter.com" + url : http://www.net-a-porter.com + - name : "Shopzilla / BizRate" + url : '' + - name : "SimplyClick" + url : '' + - name : "MedTouch" + url : '' + - name : "MusicBrainz" + url : '' + - name : "Current TV" + url : '' + - name : "The Genome Center at Washington University" + url : '' + - name : "Bioinformatics Group at University College London (UCL)" + url : '' - name : download template : download.tt outfile : download.html @@ -24,6 +84,33 @@ public : git://git.moose.perl.org/Moose.git commiter : gitmo@git.moose.perl.org:Moose.git web_view : http://git.shadowcat.co.uk/gitweb/gitweb.cgi +- name : support + template : support.tt + outfile : support.html + data : + irc : + - '#moose@irc.perl.org' + - '#moose-dev@irc.perl.org' + mailing_list : + address : moose@perl.org + archive : http://news.gmane.org/gmane.comp.lang.perl.moose + training : + - name : Infinity Interactive + url : http://www.iinteractive.com/moose/training + - name : Shadowcat Systems + url : http://www.shadowcat.co.uk/training + - name : Dave Rolsky, Inc. + url : http://www.rolsky.com/training_the_moose + consulting : + - name : Infinity Interactive + url : http://www.iinteractive.com/moose/consulting + - name : Shadowcat Systems + url : http://www.shadowcat.co.uk/consulting + misc : + - name : textmate bundle + url : http://github.com/perigrin/perl-moose.tmbundle + - name : quickref card + url : http://users.ox.ac.uk/~oliver/data/files/moose-quick-ref.pdf - name : articles template : articles.tt outfile : articles.html @@ -33,11 +120,34 @@ - title : Moose 1.00 is Released url : http://stevan-little.blogspot.com/2010/03/moose-100-is-released.html - year : 2009 - articles : [] + articles : + - title : David McLaughlin experiments with extending Moose for MooseX::ChainedAccessors + url : http://www.dmclaughlin.com/2009/05/15/chained-accessors-in-moose/ + - title : Shawn M Moore explains parameterized roles + url : http://blog.sartak.org/2009/05/parameterized-roles.html - year : 2008 - articles : [] + articles : + - title : chomatic suggests Moose and Mouse in his Beginners Introduction to Object-Oriented Programming with Perl article + url : http://broadcast.oreilly.com/2008/11/beginners-introduction-to-obje.html - year : 2007 - articles : [] + articles : + - title : Max Kanat-Alexander (of Bugzilla fame) has some nice things to say about Moose + url : http://avatraxiom.livejournal.com/70947.html - year : 2006 - articles : [] + articles : + - title : Class::MOP Review (OnLAMP) + url : http://www.oreillynet.com/onlamp/blog/2006/06/cpan_module_review_classmop.html + + + + + + + + + + + + + diff --git a/lib/Moose/Website.pm b/lib/Moose/Website.pm index a83d763..c5dc12d 100644 --- a/lib/Moose/Website.pm +++ b/lib/Moose/Website.pm @@ -2,6 +2,7 @@ package Moose::Website; use Moose; use MooseX::Types::Path::Class; +use Path::Class; use Template; use YAML::XS 'LoadFile'; use Moose::Website::I18N; @@ -11,32 +12,29 @@ our $AUTHORITY = 'cpan:STEVAN'; with 'MooseX::Getopt'; -has 'page_file' => ( +has 'outdir' => ( is => 'ro', - isa => 'Path::Class::File', + isa => 'Path::Class::Dir', coerce => 1, required => 1, ); -has 'outdir' => ( +has 'page_file' => ( is => 'ro', - isa => 'Path::Class::Dir', + isa => 'Path::Class::File', coerce => 1, - required => 1, + default => sub { + file(__FILE__)->parent->parent->parent->file('data', 'pages.yml') + } ); has 'template_root' => ( is => 'ro', isa => 'Path::Class::Dir', coerce => 1, - required => 1, -); - -has 'template_config' => ( - is => 'ro', - isa => 'HashRef', - lazy => 1, - default => sub { +{} }, + default => sub { + file(__FILE__)->parent->parent->parent->subdir('templates') + } ); has 'locale' => ( @@ -82,16 +80,29 @@ has 'tt' => ( } ); +has 'template_config' => ( + traits => [ 'NoGetopt' ], + is => 'ro', + isa => 'HashRef', + lazy => 1, + default => sub { +{} }, +); + sub log { shift; warn @_, "\n" } sub run { my $self = shift; foreach my $page ( @{ $self->pages } ) { + + my $outfile = $self->outdir->file( $page->{outfile} )->stringify; + + $self->log( "Writing page " . $page->{name} . " to $outfile using template " . $page->{template} ); + $self->tt->process( $page->{template}, $self->build_template_params( current_page => $page ), - $self->outdir->file( $page->{outfile} )->stringify + $outfile ) || confess $self->tt->error; } } diff --git a/lib/Moose/Website/I18N/po/en.po b/lib/Moose/Website/I18N/po/en.po index 41e191b..9c322bd 100644 --- a/lib/Moose/Website/I18N/po/en.po +++ b/lib/Moose/Website/I18N/po/en.po @@ -27,9 +27,12 @@ msgstr "Articles" msgid "nav download" msgstr "Download" +msgid "nav support" +msgstr "Support" + # about -msgid "about title" +msgid "about header" msgstr "About Moose" msgid "about body" @@ -37,31 +40,83 @@ msgstr "" "

Moose is a postmodern object system for Perl 5 that takes the tedium out of writing object-oriented Perl. It borrows all the best features from Perl 6, CLOS (LISP), Smalltalk, Java, BETA, OCaml, Ruby and more, while still keeping true to its Perl 5 roots.

" "

Moose is 100% production ready and in heavy use in a number of systems and growing every day. Try it today!

" +msgid "about company list header" +msgstr "Companies that use Moose" + +msgid "about company list body" +msgstr "Moose is used by a large number of companies around the world, here are a few of them." + # articles -msgid "articles title" +msgid "articles header" msgstr "Articles About Moose" # download -msgid "download title" +msgid "download header" msgstr "Download" -msgid "cpan" +msgid "download cpan header" msgstr "CPAN" -msgid "git" +msgid "download cpan body" +msgstr "Here are some CPAN modules related to Moose." + +msgid "download git header" msgstr "Git" -msgid "git public" +msgid "download git body" +msgstr "Here is the information about the Moose git repositories." + +msgid "download git public" msgstr "Git Public Repo URL" -msgid "git commiter" +msgid "download git commiter" msgstr "Git URL for Commiters" -msgid "git web view" +msgid "download git web view" msgstr "Git Web View" +# support + +msgid "support header" +msgstr "Support" + +msgid "support irc header" +msgstr "IRC Channels" + +msgid "support mailing list header" +msgstr "Mailing List" + +msgid "support misc header" +msgstr "Misc." + +msgid "support moose mailing list" +msgstr "Moose mailing list" + +msgid "support moose mailing list archives" +msgstr "Moose mailing list archives" + +msgid "support textmate bundle" +msgstr "Moose TextMate Bundle" + +msgid "support quickref card" +msgstr "Moose QuickRef Card" + +msgid "support training header" +msgstr "Moose Training" + +msgid "support training body" +msgstr "Several companies and individuals provide Moose training, here are a few." + +msgid "support consulting header" +msgstr "Moose Consulting" + +msgid "support consulting body" +msgstr "Several companies and individuals provide Moose consulting, here are a few." + + + diff --git a/templates/about.tt b/templates/about.tt index 912f840..1ecc620 100644 --- a/templates/about.tt +++ b/templates/about.tt @@ -1,6 +1,15 @@ [% WRAPPER 'wrapper/sub_page.tt' %] -

[% loc('about title') %]

- [% loc('about body') %] +

[% loc('about header') %]

+

[% loc('about body') %]

+ +

[% loc('about company list header') %]

+

[% loc('about company list body') %]

+ + [% END %] \ No newline at end of file diff --git a/templates/articles.tt b/templates/articles.tt index 3e82963..09b415f 100644 --- a/templates/articles.tt +++ b/templates/articles.tt @@ -1,6 +1,6 @@ [% WRAPPER 'wrapper/sub_page.tt' %] -

[% loc('articles title') %]

+

[% loc('articles header') %]