use warnings;
use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
use Encode;
use HTML::Entities;
IkiWiki::loadindex();
+ # If the page is internal (like a comment), see if it has a
+ # permalink. Comments do.
+ if (IkiWiki::isinternal($page) &&
+ defined $pagestate{$page}{meta}{permalink}) {
+ IkiWiki::redirect($cgi,
+ $pagestate{$page}{meta}{permalink});
+ exit;
+ }
+
my $link=bestlink("", $page);
if (! length $link) {
print "Content-type: text/html\n\n";