You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/05/05 20:46:38 UTC

[lucy-commits] svn commit: r1099915 - in /incubator/lucy/site/trunk/lib: path.pm view.pm

Author: marvin
Date: Thu May  5 18:46:37 2011
New Revision: 1099915

URL: http://svn.apache.org/viewvc?rev=1099915&view=rev
Log:
Kill off sitemap support.

The Lucy website is simple and will not need a sitemap for the forseeable
future.  Remove the unused code which would have supported generating
sitemap.html.

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=1099915&r1=1099914&r2=1099915&view=diff
==============================================================================
--- incubator/lucy/site/trunk/lib/path.pm (original)
+++ incubator/lucy/site/trunk/lib/path.pm Thu May  5 18:46:37 2011
@@ -11,7 +11,6 @@ use warnings;
 our @patterns = (
     [ qr!^/.*\.html$!, basic => {} ],
     [ qr!\.mdtext$!, basic => { template => "basic.html" } ],
-    [ qr!^/sitemap\.html$!, sitemap => {} ],
 );
 
 # The %dependecies hash is used when building pages that reference or depend
@@ -19,9 +18,7 @@ our @patterns = (
 # links to.  The keys for %dependencies are filepaths, and the values are
 # arrayrefs containing other filepaths.
 
-our %dependencies = (
-    #"/lucy/sitemap.html" => [ grep s!^content!!, glob "content/lucy/*.mdtext" ],
-);
+our %dependencies = ();
 
 1;
 

Modified: incubator/lucy/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/site/trunk/lib/view.pm?rev=1099915&r1=1099914&r2=1099915&view=diff
==============================================================================
--- incubator/lucy/site/trunk/lib/view.pm (original)
+++ incubator/lucy/site/trunk/lib/view.pm Thu May  5 18:46:37 2011
@@ -51,50 +51,6 @@ sub basic {
     return ($rendered, 'html', \%args);
 }
 
-# A view which generates a sitemap.
-
-sub sitemap {
-    my %args = @_;
-    my $template = "content$args{path}";
-    $args{breadcrumbs} .= _breadcrumbs($args{path});
-    my $dir = $template;
-    $dir =~ s!/[^/]+$!!;
-    opendir my $dh, $dir or die "Can't opendir $dir: $!\n";
-    my %data;
-    for (map "$dir/$_", grep $_ ne "." && $_ ne ".." && $_ ne ".svn", readdir $dh) {
-        if (-f and /\.mdtext$/) {
-            my $file = $_;
-            $file =~ s/^content//;
-            no warnings 'once';
-            for my $p (@path::patterns) {
-                my ($re, $method, $args) = @$p;
-                next unless $file =~ $re;
-                my $s = view->can($method) or die "Can't locate method: $method\n";
-                my ($content, $ext, $vars) = $s->(path => $file, %$args);
-                $file =~ s/\.mdtext$/.$ext/;
-                $data{$file} = $vars;
-                last;
-            }
-        }
-    }
-
-    my $content = "";
-
-    for (sort keys %data) {
-        $content .= "- [$data{$_}->{headers}->{title}]($_)\n";
-        for my $hdr (grep /^#/, split "\n", $data{$_}->{content}) {
-            $hdr =~ /^(#+)\s+([^#]+)?\s+\1\s+\{#([^}]+)\}$/ or next;
-            my $level = length $1;
-            $level *= 4;
-            $content .= " " x $level;
-            $content .= "- [$2]($_#$3)\n";
-        }
-    }
-    $args{content} = $content;
-    return Dotiac::DTL::Template($template)->render(\%args), html => \%args;
-}
-
-
 sub _breadcrumbs {
     my $path        = shift;
     my @breadcrumbs = (