From 80a8d3b03b9f91cddf9569113b55756b2d25e6b9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 24 Dec 2008 14:43:35 +0000 Subject: proviamo a fare i feed - feed.tt genera un XML senza i testi, con solo i nomi file - $xslt->fillFeed() lo frulla con un XSLT che ci mette i dati veri git-svn-id: svn://luxion/repos/WebCoso/trunk@393 fcb26f47-9200-0410-b104-b98ab5b095f3 --- lib/WebCoso/Maker.pm | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'lib/WebCoso/Maker.pm') diff --git a/lib/WebCoso/Maker.pm b/lib/WebCoso/Maker.pm index 4bc6dbb..c4659be 100644 --- a/lib/WebCoso/Maker.pm +++ b/lib/WebCoso/Maker.pm @@ -107,6 +107,22 @@ my @passes=( '=', \&parseRST], + # feeds + ["$WebCoso::Common::SRCPATH/(**)/feed.(*).xml", + ':', + "$WebCoso::Common::SRCPATH/_webcoso/tags.yml", + "$WebCoso::Common::SRCPATH/_webcoso/changes.yml", + "$WebCoso::Common::SRCPATH/\$1/feed.\$2.tt", + '=', + $template->expandTT()], + ["$WebCoso::Common::SRCPATH/feed.(*).xml", + ':', + "$WebCoso::Common::SRCPATH/_webcoso/tags.yml", + "$WebCoso::Common::SRCPATH/_webcoso/changes.yml", + "$WebCoso::Common::SRCPATH/feed.\$1.tt", + '=', + $template->expandTT()], + # tags from normal documents (tag documents can't be tagged!) ["$WebCoso::Common::SRCPATH/_webcoso/tags.yml", @@ -177,6 +193,18 @@ my @passes=( "$WebCoso::Common::SRCPATH/document.\$2.du.xml", '=', $xslt->du2html()], + + # feeds + ["$WebCoso::Common::DSTPATH/(**)/feed.(*).xml", + ':', + "$WebCoso::Common::SRCPATH/\$1/feed.\$2.xml", + '=', + $xslt->fillFeed()], + ["$WebCoso::Common::DSTPATH/feed.(*).xml", + ':', + "$WebCoso::Common::SRCPATH/feed.\$1.xml", + '=', + $xslt->fillFeed()], ], %maker_opts, }), @@ -197,7 +225,18 @@ my @passes=( =~s{^\Q$WebCoso::Common::SRCPATH\E/tags/}{$WebCoso::Common::DSTPATH/tags/}; return $file; }, - })]}, + }), + WebCoso::Common::fromTo("$WebCoso::Common::SRCPATH/", + { + files=>sub{m{^feed\.}}, + dirs=>sub{!m{^[_.]}}, + transform=>sub{ + (my $file=$_[0] + =~s{^\Q$WebCoso::Common::SRCPATH\E/}{$WebCoso::Common::DSTPATH/}; + return $file; + }, + }), + ]}, ); sub make { -- cgit v1.2.3