]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
respect permalinks
authorJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 03:28:40 +0000 (23:28 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 03:28:40 +0000 (23:28 -0400)
IkiWiki/Plugin/search.pm

index c578b44ab2693326d083a640d18f8c88cf06b042..cc26b7ac18df88d8c336fbe4b1b3f709d3fe696f 100644 (file)
@@ -112,12 +112,17 @@ sub indexhtml (@) {
        }
        $sample=~s/\n/ /g;
        
+       my $url=urlto($params{destpage}, "");
+       if (defined $pagestate{$params{page}}{meta}{permalink}) {
+               $url=$pagestate{$params{page}}{meta}{permalink}
+       }
+
        # data used by omega
        # Decode html entities in it, since omega re-encodes them.
        eval q{use HTML::Entities};
        error $@ if $@;
        $doc->set_data(
-               "url=".urlto($params{destpage}, "")."\n".
+               "url=".$url."\n".
                "sample=".decode_entities($sample)."\n".
                "caption=".decode_entities($caption)."\n".
                "modtime=$IkiWiki::pagemtime{$params{page}}\n".