You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Joe Schaefer <jo...@yahoo.com> on 2011/05/28 23:07:04 UTC
[lucy-dev] Re: [lucy-commits] svn commit: r1128773 - in /incubator/lucy/site/trunk/lib: path.pm view.pm
Are you sure you need this? I mean,
if you just drop the line that matches
.html files from path.pm, the build system
will by default copy any .html files it
sees over to the site.
----- Original Message ----
> From: "marvin@apache.org" <ma...@apache.org>
> To: lucy-commits@incubator.apache.org
> Sent: Sat, May 28, 2011 5:02:46 PM
> Subject: [lucy-commits] svn commit: r1128773 - in
>/incubator/lucy/site/trunk/lib: path.pm view.pm
>
> Author: marvin
> Date: Sat May 28 21:02:46 2011
> New Revision: 1128773
>
> URL: http://svn.apache.org/viewvc?rev=1128773&view=rev
> Log:
> Make html pages pass through properly.
>
> Modified:
> incubator/lucy/site/trunk/lib/path.pm
> incubator/lucy/site/trunk/lib/view.pm
>
> Modified: incubator/lucy/site/trunk/lib/path.pm
> URL:
>http://svn.apache.org/viewvc/incubator/lucy/site/trunk/lib/path.pm?rev=1128773&r1=1128772&r2=1128773&view=diff
>
> ==============================================================================
> --- incubator/lucy/site/trunk/lib/path.pm (original)
> +++ incubator/lucy/site/trunk/lib/path.pm Sat May 28 21:02:46 2011
> @@ -9,7 +9,7 @@ use warnings;
> # be passed to the view subroutine.
>
> our @patterns = (
> - [ qr!^/.*\.html$!, basic => {} ],
> + [ qr!^/.*\.html$!, passthrough => { type => 'html' } ],
> [ qr!\.mdtext$!, basic => { template => "basic.html" } ],
> );
>
>
> Modified: incubator/lucy/site/trunk/lib/view.pm
> URL:
>http://svn.apache.org/viewvc/incubator/lucy/site/trunk/lib/view.pm?rev=1128773&r1=1128772&r2=1128773&view=diff
>
> ==============================================================================
> --- incubator/lucy/site/trunk/lib/view.pm (original)
> +++ incubator/lucy/site/trunk/lib/view.pm Sat May 28 21:02:46 2011
> @@ -51,6 +51,15 @@ sub basic {
> return ($rendered, 'html', \%args);
> }
>
> +# Relay the page as is.
> +sub passthrough {
> + my %args = @_;
> + my $filepath = "content$args{path}";
> + open(my $fh, '<', $filepath) or die "Can't open $filepath: $!";
> + my $content = do { local $/; <$fh> };
> + return ($content, $args{type}, \%args);
> +}
> +
> sub _breadcrumbs {
> my $path = shift;
> my @breadcrumbs = (
>
>
>