openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robw...@apache.org
Subject svn commit: r1423181 - in /openoffice/ooo-site/trunk/lib: path.pm view.pm
Date Mon, 17 Dec 2012 22:03:22 GMT
Author: robweir
Date: Mon Dec 17 22:03:21 2012
New Revision: 1423181

URL: http://svn.apache.org/viewvc?rev=1423181&view=rev
Log:
Add passthru pattern and action.  html files that match this pattern will
skill the template process and are copied as-is.

Modified:
    openoffice/ooo-site/trunk/lib/path.pm
    openoffice/ooo-site/trunk/lib/view.pm

Modified: openoffice/ooo-site/trunk/lib/path.pm
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/lib/path.pm?rev=1423181&r1=1423180&r2=1423181&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/lib/path.pm (original)
+++ openoffice/ooo-site/trunk/lib/path.pm Mon Dec 17 22:03:21 2012
@@ -9,6 +9,7 @@ our @patterns = (
 	[qr!topnav.mdtext$!, single_narrative => { template => "navigator.html" }],
 	[qr!leftnav.mdtext$!, single_narrative => { template => "navigator.html" }],
 	[qr!rightnav.mdtext$!, single_narrative => { template => "navigator.html" }],
+	[qr!\-passthru.html$!, passthru],
 	[qr!\.mdtext$!, single_narrative => { template => "single_narrative.html" }],
 	[qr!\.html$!, html_page => { template => "html_page.html" }],
 	[qr!\.htm$!, html_page => { template => "html_page.html" }],

Modified: openoffice/ooo-site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/lib/view.pm?rev=1423181&r1=1423180&r2=1423181&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/lib/view.pm (original)
+++ openoffice/ooo-site/trunk/lib/view.pm Mon Dec 17 22:03:21 2012
@@ -142,6 +142,15 @@ sub sitemap {
     return Template($template)->render(\%args), html => \%args;
 }
 
+# Passthru filter, applies no template
+
+sub passthru {
+    my %args = @_;
+    open my $fh, "content$args{path}" or die "Can't open $args{path}:$!";
+    read $fh, my $content, -s $fh;
+    return $content, html => %args;
+}
+
 sub breadcrumbs {
     my @path = split m!/!, shift;
     pop @path;



Mime
View raw message