You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by jo...@apache.org on 2012/02/15 17:28:42 UTC
[Lucene.Net] svn commit: r1244569 - in /incubator/lucene.net/site/trunk/lib: path.pm
view.pm
Author: joes
Date: Wed Feb 15 16:28:42 2012
New Revision: 1244569
URL: http://svn.apache.org/viewvc?rev=1244569&view=rev
Log:
see if this fixes the homepage generation
Modified:
incubator/lucene.net/site/trunk/lib/path.pm
incubator/lucene.net/site/trunk/lib/view.pm
Modified: incubator/lucene.net/site/trunk/lib/path.pm
URL: http://svn.apache.org/viewvc/incubator/lucene.net/site/trunk/lib/path.pm?rev=1244569&r1=1244568&r2=1244569&view=diff
==============================================================================
--- incubator/lucene.net/site/trunk/lib/path.pm (original)
+++ incubator/lucene.net/site/trunk/lib/path.pm Wed Feb 15 16:28:42 2012
@@ -10,13 +10,11 @@ use warnings;
# be passed to the view subroutine.
our @patterns = (
- [ qr!^/index\.html$!, basic => {
- template => "template.html",
+[ qr!^/index\.html$!, news_page => {
blog => ASF::Value::Blogs->new(blog => "lucenenet", limit=> 4),
} ],
[ qr!\.mdtext$!, basic => {
template => "template.html",
- blog => ASF::Value::Blogs->new(blog => "lucenenet", limit=> 4),
} ],
[ qr!^/sitemap\.html$!, sitemap => {} ],
);
Modified: incubator/lucene.net/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/incubator/lucene.net/site/trunk/lib/view.pm?rev=1244569&r1=1244568&r2=1244569&view=diff
==============================================================================
--- incubator/lucene.net/site/trunk/lib/view.pm (original)
+++ incubator/lucene.net/site/trunk/lib/view.pm Wed Feb 15 16:28:42 2012
@@ -66,6 +66,25 @@ sub basic {
}
+sub news_page {
+ my %args = @_;
+ my $template = "content$args{path}";
+ $args{breadcrumbs} = breadcrumbs($args{path});
+
+ my $page_path = $template;
+ $page_path =~ s/\.[^.]+$/.page/;
+ if (-d $page_path) {
+ for my $f (grep -f, glob "$page_path/*.mdtext") {
+ $f =~ m!/([^/]+)\.mdtext$! or die "Bad filename: $f\n";
+ $args{$1} = {};
+ read_text_file $f, $args{$1};
+ }
+ }
+
+ return Template($template)->render(\%args), html => \%args;
+}
+
+
# A view which generates a sitemap.