X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/5951c1dc8220cbc09e6bdda09bae92aa4e3236e3..5591d621b90855beeb5460f0ac11279d19835699:/IkiWiki/Render.pm diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7d2e8c4ee..7d1e8ee53 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -9,7 +9,8 @@ sub linkify ($$) { #{{{ my $page=shift; $content =~ s{(\\?)$config{wiki_link_regexp}}{ - $1 ? "[[$2]]" : htmllink($page, $2) + $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2))) + : ( $1 ? "[[$3]]" : htmllink($page, titlepage($3))) }eg; return $content; @@ -159,13 +160,23 @@ sub postprocess_html_inline { #{{{ $params{show}=10; } $inlinepages{$parentpage}=$params{pages}; - + + my $ret=""; + + if (exists $params{rootpage}) { + my $formtemplate=HTML::Template->new(blind_cache => 1, + filename => "$config{templatedir}/blogpost.tmpl"); + $formtemplate->param(cgiurl => $config{cgiurl}); + $formtemplate->param(rootpage => $params{rootpage}); + my $form=$formtemplate->output; + $ret.=$form; + } + my $template=HTML::Template->new(blind_cache => 1, filename => (($params{archive} eq "no") ? "$config{templatedir}/inlinepage.tmpl" : "$config{templatedir}/inlinepagetitle.tmpl")); - my $ret=""; foreach my $page (blog_list($params{pages}, $params{show})) { next if $page eq $parentpage; $template->param(pagelink => htmllink($parentpage, $page)); @@ -175,7 +186,7 @@ sub postprocess_html_inline { #{{{ $ret.=$template->output; } - return $ret; + return "

$ret

"; } #}}} sub genpage ($$$) { #{{{ @@ -191,10 +202,10 @@ sub genpage ($$$) { #{{{ filename => "$config{templatedir}/page.tmpl"); if (length $config{cgiurl}) { - $template->param(editurl => "$config{cgiurl}?do=edit&page=$page"); - $template->param(prefsurl => "$config{cgiurl}?do=prefs"); + $template->param(editurl => cgiurl(do => "edit", page => $page)); + $template->param(prefsurl => cgiurl(do => "prefs")); if ($config{rcs}) { - $template->param(recentchangesurl => "$config{cgiurl}?do=recentchanges"); + $template->param(recentchangesurl => cgiurl(do => "recentchanges")); } } @@ -204,8 +215,8 @@ sub genpage ($$$) { #{{{ $template->param(historyurl => $u); } - if ($config{rss}) { - $template->param(rssurl => rsspage($page)); + if ($config{rss} && $inlinepages{$page}) { + $template->param(rssurl => rsspage(basename($page))); } $template->param( @@ -216,6 +227,7 @@ sub genpage ($$$) { #{{{ backlinks => [backlinks($page)], discussionlink => htmllink($page, "Discussion", 1, 1), mtime => scalar(gmtime($mtime)), + styleurl => styleurl($page), ); return $template->output; @@ -238,7 +250,7 @@ sub absolute_urls ($$) { #{{{ $content=~s/ $gen_blog); - # Regular page gets a feed that is updated every time the - # page is changed, so the mtime is encoded in the guid. - push @items, { - itemtitle => pagetitle(basename($page)), - itemguid => "$url?mtime=$mtime", - itemurl => $url, - itempubdate => date_822($mtime), - itemcontent => absolute_urls($content, $url), - } unless $isblog; - $template->param( title => $config{wikiname}, pageurl => $url, @@ -316,9 +315,9 @@ sub check_overwrite ($$) { #{{{ } #}}} sub mtime ($) { #{{{ - my $page=shift; + my $file=shift; - return (stat($page))[9]; + return (stat($file))[9]; } #}}} sub findlinks ($$) { #{{{ @@ -327,7 +326,7 @@ sub findlinks ($$) { #{{{ my @links; while ($content =~ /(?