X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/54d5308cd83c67e7e9c32450c776ef0dac63549f..57743730468b4a7ccaa724ac82739ca0c79de809:/IkiWiki/Plugin/inline.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 53ea5bf18..9a86aad0b 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -4,9 +4,11 @@ package IkiWiki::Plugin::inline; use warnings; use strict; +use IkiWiki; sub import { #{{{ - IkiWiki::register_plugin("preprocess", "inline", \&IkiWiki::preprocess_inline); + IkiWiki::hook(type => "preprocess", id => "inline", + call => \&IkiWiki::preprocess_inline); } # }}} # Back to ikiwiki namespace for the rest, this code is very much @@ -57,10 +59,10 @@ sub preprocess_inline (@) { #{{{ foreach my $page (blog_list($params{pages}, $params{show})) { next if $page eq $params{page}; push @pages, $page; - $template->param(pagelink => htmllink($params{page}, $page)); + $template->param(pagelink => htmllink($params{page}, $params{page}, $page)); $template->param(content => get_inline_content($params{page}, $page)) if $params{archive} eq "no"; - $template->param(ctime => scalar(gmtime($pagectime{$page}))); + $template->param(ctime => displaytime($pagectime{$page})); $ret.=$template->output; } @@ -98,7 +100,7 @@ sub get_inline_content ($$) { #{{{ my $file=$pagesources{$page}; my $type=pagetype($file); if ($type ne 'unknown') { - return htmlize($type, linkify(readfile(srcfile($file)), $parentpage)); + return htmlize($type, preprocess($page, linkify($page, $parentpage, readfile(srcfile($file))), 1)); } else { return ""; @@ -119,8 +121,8 @@ sub absolute_urls ($$) { #{{{ $url=~s/[^\/]+$//; - $content=~s/