diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-26 16:11:53 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-26 16:11:53 +0000 |
commit | 65d0aee407f81db9ca2261fc8ecb1958f62302a9 (patch) | |
tree | 5a3e69dd458e7455943e7b18738719cf7eb40fe1 /IkiWiki | |
parent | 29507e94a46d0f2006671d31ac6812ebd0715cee (diff) |
* --getctime had bitrotted (well I only ever used it the once so far..),
* When inlining a page in another one, links from the inlined page are now
expanded the same as they are when rendering the inlined page as a
standalone page. So rather than being expanded from the POV of the
inlining page, they are expanded from the POV of the inlined page.
For example, a link from blog/foo to "bar" will now link to blog/bar
if it exists. Previously this needed to be a link explicitly to
"blog/bar"; such links will also continue to work.
(This was slightly complex to do as the link still has to be constructed
relative to the inlining page.)
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/CGI.pm | 12 | ||||
-rw-r--r-- | IkiWiki/Plugin/brokenlinks.pm | 4 | ||||
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 4 | ||||
-rw-r--r-- | IkiWiki/Plugin/orphans.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/smiley.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Render.pm | 11 |
6 files changed, 18 insertions, 17 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 2483bf4d8..6ead8fc56 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -19,8 +19,8 @@ sub page_locked ($$;$) { #{{{ my $locked_pages=userinfo_get($admin, "locked_pages"); if (globlist_match($page, userinfo_get($admin, "locked_pages"))) { return 1 if $nonfatal; - error(htmllink("", $page, 1)." is locked by ". - htmllink("", $admin, 1)." and cannot be edited."); + error(htmllink("", "", $page, 1)." is locked by ". + htmllink("", "", $admin, 1)." and cannot be edited."); } } @@ -246,9 +246,9 @@ sub cgi_prefs ($$) { #{{{ $form->field(name => "password", type => "password"); $form->field(name => "confirm_password", type => "password"); $form->field(name => "subscriptions", size => 50, - comment => "(".htmllink("", "GlobList", 1).")"); + comment => "(".htmllink("", "", "GlobList", 1).")"); $form->field(name => "locked_pages", size => 50, - comment => "(".htmllink("", "GlobList", 1).")"); + comment => "(".htmllink("", "", "GlobList", 1).")"); if (! is_admin($user_name)) { $form->field(name => "locked_pages", type => "hidden"); @@ -335,7 +335,7 @@ sub cgi_editpage ($$) { #{{{ $form->tmpl_param("can_commit", $config{rcs}); $form->tmpl_param("indexlink", indexlink()); $form->tmpl_param("helponformattinglink", - htmllink("", "HelpOnFormatting", 1)); + htmllink("", "", "HelpOnFormatting", 1)); $form->tmpl_param("styleurl", styleurl()); $form->tmpl_param("baseurl", "$config{url}/"); if (! $form->submitted) { @@ -351,7 +351,7 @@ sub cgi_editpage ($$) { #{{{ require IkiWiki::Render; $form->tmpl_param("page_preview", htmlize($config{default_pageext}, - linkify($page, $form->field('content')))); + linkify($page, $page, $form->field('content')))); } else { $form->tmpl_param("page_preview", ""); diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index 22590366b..deee58222 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -27,9 +27,9 @@ sub preprocess (@) { #{{{ my $bestlink=IkiWiki::bestlink($page, $link); next if length $bestlink; push @broken, - IkiWiki::htmllink($page, $link, 1). + IkiWiki::htmllink($page, $page, $link, 1). " in ". - IkiWiki::htmllink($params{page}, $page, 1); + IkiWiki::htmllink($params{page}, $params{page}, $page, 1); } } } diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index a11e5a52b..8b67bfa61 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -59,7 +59,7 @@ 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}))); @@ -100,7 +100,7 @@ sub get_inline_content ($$) { #{{{ my $file=$pagesources{$page}; my $type=pagetype($file); if ($type ne 'unknown') { - return htmlize($type, linkify($parentpage, readfile(srcfile($file)))); + return htmlize($type, linkify($page, $parentpage, readfile(srcfile($file)))); } else { return ""; diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index a7aa89f58..f8035db54 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -36,7 +36,7 @@ sub preprocess (@) { #{{{ } return "All pages are linked to by other pages." unless @orphans; - return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $_, 1)."</li>" } sort @orphans)."</ul>\n"; + return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $params{page}, $_, 1)."</li>" } sort @orphans)."</ul>\n"; } # }}} 1 diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm index 5f05e3a4c..f49c9b62f 100644 --- a/IkiWiki/Plugin/smiley.pm +++ b/IkiWiki/Plugin/smiley.pm @@ -35,7 +35,7 @@ sub filter (@) { #{{{ my %params=@_; $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{ - $1 ? $2 : IkiWiki::htmllink($params{page}, $smileys{$2}, 0, 0, $2) + $1 ? $2 : IkiWiki::htmllink($params{page}, $params{page}, $smileys{$2}, 0, 0, $2) }egs; return $params{content}; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 08f5e7e95..df08eb49c 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -7,13 +7,14 @@ use strict; use File::Spec; use IkiWiki; -sub linkify ($$) { #{{{ +sub linkify ($$$) { #{{{ + my $lpage=shift; my $page=shift; my $content=shift; $content =~ s{(\\?)$config{wiki_link_regexp}}{ - $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2))) - : ( $1 ? "[[$3]]" : htmllink($page, titlepage($3))) + $2 ? ( $1 ? "[[$2|$3]]" : htmllink($lpage, $page, titlepage($3), 0, 0, pagetitle($2))) + : ( $1 ? "[[$3]]" : htmllink($lpage, $page, titlepage($3))) }eg; return $content; @@ -181,7 +182,7 @@ sub genpage ($$$) { #{{{ $actions++; } if ($config{discussion}) { - $template->param(discussionlink => htmllink($page, "Discussion", 1, 1)); + $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1)); $actions++; } @@ -267,7 +268,7 @@ sub render ($) { #{{{ $links{$page}=[findlinks($page, $content)]; - $content=linkify($page, $content); + $content=linkify($page, $page, $content); $content=preprocess($page, $content); $content=htmlize($type, $content); |