X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/01b058a28570e60c928c2b7f2c83512e6fe84145..c01030c14742db9f87de62ceb7c77dc156c7380f:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 9cf781a25..08e1f2769 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -4,7 +4,7 @@ package IkiWiki::Plugin::inline; use warnings; use strict; -use IkiWiki 1.00; +use IkiWiki 2.00; use URI; sub import { #{{{ @@ -88,7 +88,7 @@ sub preprocess_inline (@) { #{{{ my @list; foreach my $page (keys %pagesources) { next if $page eq $params{page}; - if (pagespec_match($page, $params{pages}, $params{page})) { + if (pagespec_match($page, $params{pages}, location => $params{page})) { push @list, $page; } } @@ -155,6 +155,7 @@ sub preprocess_inline (@) { #{{{ $ret.=$linktemplate->output; } + require HTML::Template; my @params=IkiWiki::template_params($params{template}.".tmpl", blind_cache => 1); if (! @params) { return sprintf(gettext("nonexistant template %s"), $params{template}); @@ -212,7 +213,7 @@ sub preprocess_inline (@) { #{{{ $ret.="\n". linkify($page, $params{page}, preprocess($page, $params{page}, - filter($page, + filter($page, $params{page}, readfile(srcfile($file))))); } } @@ -222,6 +223,9 @@ sub preprocess_inline (@) { #{{{ if (exists $params{feedshow} && @list > $params{feedshow}) { @list=@list[0..$params{feedshow} - 1]; } + if (exists $params{feedpages}) { + @list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list; + } if ($rss) { my $rssp=rsspage($params{page}); @@ -263,7 +267,7 @@ sub get_inline_content ($$) { #{{{ return htmlize($page, $type, linkify($page, $destpage, preprocess($page, $destpage, - filter($page, + filter($page, $destpage, readfile(srcfile($file)))))); } else { @@ -299,9 +303,9 @@ sub absolute_urls ($$) { #{{{ my $url=$baseurl; $url=~s/[^\/]+$//; - $content=~s/(new(encode_utf8($config{url}."/".htmlpage($page))); + my $url=URI->new(encode_utf8($config{url}."/".urlto($page,""))); my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1); my $content=""; my $lasttime = 0; foreach my $p (@pages) { - my $u=URI->new(encode_utf8($config{url}."/".htmlpage($p))); - + my $u=URI->new(encode_utf8($config{url}."/".urlto($p, ""))); my $pcontent = absolute_urls(get_inline_content($p, $page), $url); $itemtemplate->param( - title => pagetitle(basename($p), 1), + title => pagetitle(basename($p)), url => $u, permalink => $u, date_822 => date_822($pagectime{$p}), @@ -375,7 +378,7 @@ sub genfeed ($$$$@) { #{{{ my $template=template($feedtype."page.tmpl", blind_cache => 1); $template->param( - title => $page ne "index" ? pagetitle($page, 1) : $config{wikiname}, + title => $page ne "index" ? pagetitle($page) : $config{wikiname}, wikiname => $config{wikiname}, pageurl => $url, content => $content, @@ -415,7 +418,7 @@ sub pingurl (@) { #{{{ foreach my $page (keys %toping) { my $title=pagetitle(basename($page), 0); - my $url="$config{url}/".htmlpage($page); + my $url="$config{url}/".urlto($page, ""); foreach my $pingurl (@{$config{pingurl}}) { debug("Pinging $pingurl for $page"); eval {