]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
merge dups
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 30 Jan 2009 19:07:03 +0000 (14:07 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 30 Jan 2009 19:07:03 +0000 (14:07 -0500)
doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn
doc/todo/using_meta_titles_for_parentlinks.html [deleted file]

index cccd53d0530b924f9ae54dbec3505e4063fe19f2..11735f77007abc4205c8da81dc25d36ef1695e78 100644 (file)
@@ -2,8 +2,127 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title
 
 --[[madduck]]
 
-> Agreed. [[todo/using_meta_titles_for_parentlinks]] contains a beginning of
-> solution. A few quick notes about it:
+----
+
+It is possible to set a Page-Title in the meta-plugin, but that one isn't
+reused in parentlinks. This [[patch]] may fix it.
+
+<ul>
+<li> I give pagetitle the full path to a page.
+<li> I redefine the 'pagetitle'-sub to deal with it.
+<li> to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle.
+</ul>
+
+<pre>
+diff -c /usr/share/perl5/IkiWiki/Render.pm.distrib /usr/share/perl5/IkiWiki/Render.pm
+*** /usr/share/perl5/IkiWiki/Render.pm.distrib  Wed Aug  6 07:34:55 2008
+--- /usr/share/perl5/IkiWiki/Render.pm  Tue Aug 26 23:29:32 2008
+***************
+*** 102,108 ****
+        $template->param(
+                title => $page eq 'index' 
+                        ? $config{wikiname} 
+!                       : pagetitle(basename($page)),
+                wikiname => $config{wikiname},
+                content => $content,
+                backlinks => $backlinks,
+--- 102,108 ----
+        $template->param(
+                title => $page eq 'index' 
+                        ? $config{wikiname} 
+!                       : pagetitle($page),
+                wikiname => $config{wikiname},
+                content => $content,
+                backlinks => $backlinks,
+
+diff -c /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm
+*** /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib      Wed Aug  6 07:34:55 2008
+--- /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm      Tue Aug 26 23:19:43 2008
+***************
+*** 44,50 ****
+                        "height_$height" => 1,
+                };
+                $path.="/".$dir;
+!               $title=IkiWiki::pagetitle($dir);
+                $i++;
+        }
+        return @ret;
+--- 44,50 ----
+                        "height_$height" => 1,
+                };
+                $path.="/".$dir;
+!               $title=IkiWiki::pagetitle($path);
+                $i++;
+        }
+        return @ret;
+
+diff -c /usr/share/perl5/IkiWiki.pm.distrib /usr/share/perl5/IkiWiki.pm
+*** /usr/share/perl5/IkiWiki.pm.distrib Wed Aug  6 07:48:34 2008
+--- /usr/share/perl5/IkiWiki.pm Tue Aug 26 23:47:30 2008
+***************
+*** 792,797 ****
+--- 792,799 ----
+        my $page=shift;
+        my $unescaped=shift;
+  
++       $page=basename($page);
++ 
+        if ($unescaped) {
+                $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
+       }
+
+diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki/Plugin/meta.pm
+*** /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib     Wed Aug  6 07:34:55 2008
+--- /usr/share/perl5/IkiWiki/Plugin/meta.pm     Tue Aug 26 23:30:58 2008
+***************
+*** 3,8 ****
+--- 3,9 ----
+  package IkiWiki::Plugin::meta;
+  
+  use warnings;
++ no warnings 'redefine';
+  use strict;
+  use IkiWiki 2.00;
+  
+***************
+*** 289,294 ****
+--- 290,319 ----
+        }
+  }
+  
++ sub IkiWiki::pagetitle ($;$) {
++       my $page=shift;
++       my $unescaped=shift;
++ 
++       if ($page =~ m#/#) {
++               $page =~ s#^/##;
++               $page =~ s#/index$##;
++               if ($pagestate{"$page/index"}{meta}{title}) {
++                       $page = $pagestate{"$page/index"}{meta}{title};
++               } else {
++                       $page = IkiWiki::basename($page);
++               }
++       }
++ 
++       if ($unescaped) {
++               $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
++       }
++       else {
++               $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
++       }
++ 
++       return $page;
++ }
++ 
+  package IkiWiki::PageSpec;
+  
+  sub match_title ($$;@) {
+
+</pre>
+
+--
+
+> A few quick notes about it:
 
 > - Using <code>inline</code> would avoid the redefinition + code duplication.
 > - A few plugins would need to be upgraded.
diff --git a/doc/todo/using_meta_titles_for_parentlinks.html b/doc/todo/using_meta_titles_for_parentlinks.html
deleted file mode 100644 (file)
index 6da40a4..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-It is possible to set a Page-Title in the meta-plugin, but that one isn't
-reused in parentlinks. This [[patch]] may fix it.
-
-<ul>
-<li> I give pagetitle the full path to a page.
-<li> I redefine the 'pagetitle'-sub to deal with it.
-<li> to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle.
-</ul>
-
-<pre>
-diff -c /usr/share/perl5/IkiWiki/Render.pm.distrib /usr/share/perl5/IkiWiki/Render.pm
-*** /usr/share/perl5/IkiWiki/Render.pm.distrib  Wed Aug  6 07:34:55 2008
---- /usr/share/perl5/IkiWiki/Render.pm  Tue Aug 26 23:29:32 2008
-***************
-*** 102,108 ****
-        $template->param(
-                title => $page eq 'index' 
-                        ? $config{wikiname} 
-!                       : pagetitle(basename($page)),
-                wikiname => $config{wikiname},
-                content => $content,
-                backlinks => $backlinks,
---- 102,108 ----
-        $template->param(
-                title => $page eq 'index' 
-                        ? $config{wikiname} 
-!                       : pagetitle($page),
-                wikiname => $config{wikiname},
-                content => $content,
-                backlinks => $backlinks,
-
-diff -c /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm
-*** /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib      Wed Aug  6 07:34:55 2008
---- /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm      Tue Aug 26 23:19:43 2008
-***************
-*** 44,50 ****
-                        "height_$height" => 1,
-                };
-                $path.="/".$dir;
-!               $title=IkiWiki::pagetitle($dir);
-                $i++;
-        }
-        return @ret;
---- 44,50 ----
-                        "height_$height" => 1,
-                };
-                $path.="/".$dir;
-!               $title=IkiWiki::pagetitle($path);
-                $i++;
-        }
-        return @ret;
-
-diff -c /usr/share/perl5/IkiWiki.pm.distrib /usr/share/perl5/IkiWiki.pm
-*** /usr/share/perl5/IkiWiki.pm.distrib Wed Aug  6 07:48:34 2008
---- /usr/share/perl5/IkiWiki.pm Tue Aug 26 23:47:30 2008
-***************
-*** 792,797 ****
---- 792,799 ----
-        my $page=shift;
-        my $unescaped=shift;
-  
-+       $page=basename($page);
-+ 
-        if ($unescaped) {
-                $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
-       }
-
-diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki/Plugin/meta.pm
-*** /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib     Wed Aug  6 07:34:55 2008
---- /usr/share/perl5/IkiWiki/Plugin/meta.pm     Tue Aug 26 23:30:58 2008
-***************
-*** 3,8 ****
---- 3,9 ----
-  package IkiWiki::Plugin::meta;
-  
-  use warnings;
-+ no warnings 'redefine';
-  use strict;
-  use IkiWiki 2.00;
-  
-***************
-*** 289,294 ****
---- 290,319 ----
-        }
-  }
-  
-+ sub IkiWiki::pagetitle ($;$) {
-+       my $page=shift;
-+       my $unescaped=shift;
-+ 
-+       if ($page =~ m#/#) {
-+               $page =~ s#^/##;
-+               $page =~ s#/index$##;
-+               if ($pagestate{"$page/index"}{meta}{title}) {
-+                       $page = $pagestate{"$page/index"}{meta}{title};
-+               } else {
-+                       $page = IkiWiki::basename($page);
-+               }
-+       }
-+ 
-+       if ($unescaped) {
-+               $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
-+       }
-+       else {
-+               $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
-+       }
-+ 
-+       return $page;
-+ }
-+ 
-  package IkiWiki::PageSpec;
-  
-  sub match_title ($$;@) {
-
-
-</pre>
-
-<p>
-This is actually a duplicate for
-[[bugs/pagetitle_function_does_not_respect_meta_titles]], where I'm
-following up a bit. --[[intrigeri]]
-</p>
\ No newline at end of file