You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jo...@apache.org on 2014/03/19 06:12:22 UTC
svn commit: r1579136 - /thrift/cms-site/trunk/lib/path.pm
Author: joes
Date: Wed Mar 19 05:12:22 2014
New Revision: 1579136
URL: http://svn.apache.org/r1579136
Log:
support index.html pages as generated from news views
Modified:
thrift/cms-site/trunk/lib/path.pm
Modified: thrift/cms-site/trunk/lib/path.pm
URL: http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/path.pm?rev=1579136&r1=1579135&r2=1579136&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/path.pm (original)
+++ thrift/cms-site/trunk/lib/path.pm Wed Mar 19 05:12:22 2014
@@ -12,6 +12,7 @@ our @patterns = (
conf => $conf,
headers => { title => "Sitemap" },
}],
+ [qr!/index\.html$!, news_page => { conf => $conf, headers => { title => "Index" } }],
[qr/\.md(?:text)?$/, single_narrative => {
conf => $conf,
template => 'default.html',
@@ -23,13 +24,6 @@ our $runners = 1; # maximize page memoiz
my @mdfiles; # basically grep s/^content//, glob "content/**/*.{md,mdtext}"
# if perl's glob was as smart as zsh's glob
-find({ wanted => sub {
- $File::Find::prune = 1, return if -d and m!\.page$!;
- if (/\.md(?:text)?$/) {
- s/^.*content//;
- push @mdfiles, $_;
- }
- }, no_chdir => 1 }, cwd() . "/content");
our %dependencies = (
"/docs.md" => [ grep s/^content//, glob("content/docs/*.{md,mdtext}"),
@@ -37,6 +31,20 @@ our %dependencies = (
"/sitemap.html" => \@mdfiles,
);
+
+find({ wanted => sub {
+ $File::Find::prune = 1, return if -d and m!\.page$!;
+ s/^.*content//;
+ if (/\.md(?:text)?$/) {
+ push @mdfiles, $_;
+ }
+ if (s!/index.html$!!) {
+ $dependencies{"$_/index.html"} = [
+ grep s/^content//, glob("content$_/*.{md,mdtext}"),
+ glob("content$_/*/index.html") ],
+ }
+ }, no_chdir => 1 }, cwd() . "/content");
+
1;