trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1210327 - in /trafficserver/site/branches/ats-cms/lib: path.pm view.pm
Date Mon, 05 Dec 2011 04:11:17 GMT
Author: amc
Date: Mon Dec  5 04:11:17 2011
New Revision: 1210327

URL: http://svn.apache.org/viewvc?rev=1210327&view=rev
Log:
Cleaning up after Igor's rampage.

Modified:
    trafficserver/site/branches/ats-cms/lib/path.pm
    trafficserver/site/branches/ats-cms/lib/view.pm

Modified: trafficserver/site/branches/ats-cms/lib/path.pm
URL: http://svn.apache.org/viewvc/trafficserver/site/branches/ats-cms/lib/path.pm?rev=1210327&r1=1210326&r2=1210327&view=diff
==============================================================================
--- trafficserver/site/branches/ats-cms/lib/path.pm (original)
+++ trafficserver/site/branches/ats-cms/lib/path.pm Mon Dec  5 04:11:17 2011
@@ -7,8 +7,8 @@ our @patterns = (
 
 #   [qr!^/(index|downloads|docs/search)\...\.mdtext$!, single_narrative => { template
=> "front_page.html" }],
 
+    [qr!^/downloads\...\.mdtext$!, standalone_page => { template => "docs_page.html"
}],
     [qr!^/((docs|dev)/)?.*\.mdtext$!, single_narrative => { template => "docs_page.html"
}],
-   [qr!^/downloads\...\.mdtext$!, single_narrative => { template => "front_page.html"
}],
 
 );
 

Modified: trafficserver/site/branches/ats-cms/lib/view.pm
URL: http://svn.apache.org/viewvc/trafficserver/site/branches/ats-cms/lib/view.pm?rev=1210327&r1=1210326&r2=1210327&view=diff
==============================================================================
--- trafficserver/site/branches/ats-cms/lib/view.pm (original)
+++ trafficserver/site/branches/ats-cms/lib/view.pm Mon Dec  5 04:11:17 2011
@@ -477,6 +477,25 @@ sub single_narrative {
     return Dotiac::DTL::Template($template)->render(\%args), html => \%args;
 }
 
+# Similar to single_narrative but does no auto navigation.
+sub standalone_page {
+    my %args = @_;
+    my $file = SRC_DIR . $args{path};
+    my $template = $args{template};
+    $args{path} =~ s/\.mdtext$/\.html/;
+    
+    ## Set globals.
+    # base URL for the page. Pass it on to the template as well.
+    if ($PAGE_BASE = $ENV{ATS_CMS_PAGE_BASE}) {
+        $args{page_base} = $PAGE_BASE;
+    }
+    # base output directory.
+    $TARGET_BASE = $ENV{TARGET_BASE};
+
+    read_text_file $file, \%args;
+    return Dotiac::DTL::Template($template)->render(\%args), html => \%args;
+}
+
 # Has the same behavior as the above for foo.page/bar.txt
 # files, parsing them into a bar variable for the template.
 # Otherwise presumes the template is the path.
@@ -805,10 +824,6 @@ sub nav_links {
 sub langs {
     my ($src, $lang) = @_;
     my @langs; # Return: List of link objects.
-    if (not $lang) {
-        die "Bob\n";
-    }
-
     for my $ol ($src->langList) {    
         next if $ol eq $lang; # don't include us.
         push(@langs, { text=>$ol, url=>$src->langToFile($ol) } );



Mime
View raw message