]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
fix feed urls
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index 7d81e918271809c3d6acd5ded979b1255233cc09..10f78cb3b1c591230b7acb571f08d600a6473e0c 100644 (file)
@@ -70,12 +70,12 @@ sub sessioncgi () { #{{{
        my $session=shift;
 
        if ($q->param('do') eq 'blog') {
-               my $page=decode_utf8($q->param('title'));
-               $page=~s/\///g; # no slashes in blog posts
+               my $page=IkiWiki::titlepage(decode_utf8($q->param('title')));
+               $page=~s/(\/)/"__".ord($1)."__"/eg; # don't create subdirs
                # if the page already exists, munge it to be unique
                my $from=$q->param('from');
                my $add="";
-               while (exists $IkiWiki::pagecase{lc($from."/".IkiWiki::titlepage($page).$add)}) {
+               while (exists $IkiWiki::pagecase{lc($from."/".$page.$add)}) {
                        $add=1 unless length $add;
                        $add++;
                }
@@ -278,7 +278,7 @@ sub preprocess_inline (@) { #{{{
                                        }
                                        if (length $config{cgiurl} && defined $type) {
                                                $template->param(have_actions => 1);
-                                               $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1)));
+                                               $template->param(editurl => cgiurl(do => "edit", page => $page));
                                        }
                                }
        
@@ -352,7 +352,7 @@ sub get_inline_content ($$) { #{{{
        my $type=pagetype($file);
        if (defined $type) {
                $nested++;
-               my $ret=htmlize($page, $type,
+               my $ret=htmlize($page, $destpage, $type,
                       linkify($page, $destpage,
                       preprocess($page, $destpage,
                       filter($page, $destpage,
@@ -423,13 +423,13 @@ sub genfeed ($$$$@) { #{{{
        my $page=shift;
        my @pages=@_;
        
-       my $url=URI->new(encode_utf8($config{url}."/".urlto($page,"")));
+       my $url=URI->new(encode_utf8(urlto($page,"",1)));
        
        my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1);
        my $content="";
        my $lasttime = 0;
        foreach my $p (@pages) {
-               my $u=URI->new(encode_utf8($config{url}."/".urlto($p, "")));
+               my $u=URI->new(encode_utf8(urlto($p, "", 1)));
                my $pcontent = absolute_urls(get_inline_content($p, $page), $url);
 
                $itemtemplate->param(
@@ -519,7 +519,7 @@ sub pingurl (@) { #{{{
 
        foreach my $page (keys %toping) {
                my $title=pagetitle(basename($page), 0);
-               my $url="$config{url}/".urlto($page, "");
+               my $url=urlto($page, "", 1);
                foreach my $pingurl (@{$config{pingurl}}) {
                        debug("Pinging $pingurl for $page");
                        eval {