aboutsummaryrefslogtreecommitdiff
path: root/doc/patchqueue
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-03 07:39:50 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-03 07:39:50 +0000
commit4560013bf90e59450da77f019ff03a9e72a06c3e (patch)
tree8e2e16d899cb9c3eab6d88f70449799c958a57aa /doc/patchqueue
parent97aea861624d1a1c6127857adb19dce16eab510e (diff)
downloadikiwiki-4560013bf90e59450da77f019ff03a9e72a06c3e.tar
ikiwiki-4560013bf90e59450da77f019ff03a9e72a06c3e.tar.gz
web commit by http://per.bothner.com/: Alternate simple patch to view "A/B/C/index" as the same as "A/B/C".
Diffstat (limited to 'doc/patchqueue')
-rw-r--r--doc/patchqueue/index.html_allowed.mdwn44
1 files changed, 43 insertions, 1 deletions
diff --git a/doc/patchqueue/index.html_allowed.mdwn b/doc/patchqueue/index.html_allowed.mdwn
index 6af5287a4..d41d17a50 100644
--- a/doc/patchqueue/index.html_allowed.mdwn
+++ b/doc/patchqueue/index.html_allowed.mdwn
@@ -118,4 +118,46 @@ In case whitespace gets garbled, I'm also leaving a copy of the patch on [my sit
+ $page=~s!/$!!;
return $page;
- } #}}} \ No newline at end of file
+ } #}}}
+
+I independently implemented a similar, but smaller patch.
+(It's smaller because I only care about rendering; not CGI, for example.)
+The key to this patch is that "A/B/C" is treated as equivalent
+to "A/B/C/index".
+Here it is: --Per Bothner
+
+ --- IkiWiki/Render.pm~ 2007-01-11 15:01:51.000000000 -0800
+ +++ IkiWiki/Render.pm 2007-02-02 22:24:12.000000000 -0800
+ @@ -60,9 +60,9 @@
+ foreach my $dir (reverse split("/", $page)) {
+ if (! $skip) {
+ $path.="../";
+ - unshift @ret, { url => $path.htmlpage($dir), page => pagetitle($dir) };
+ + unshift @ret, { url => abs2rel(htmlpage(bestlink($page, $dir)), dirname($page)), page => pagetitle($dir) };
+ }
+ - else {
+ + elsif ($dir ne "index") {
+ $skip=0;
+ }
+ }
+
+ --- IkiWiki.pm~ 2007-01-12 12:47:09.000000000 -0800
+ +++ IkiWiki.pm 2007-02-02 18:02:16.000000000 -0800
+ @@ -315,6 +315,12 @@
+ elsif (exists $pagecase{lc $l}) {
+ return $pagecase{lc $l};
+ }
+ + else {
+ + my $lindex = $l . "/index";
+ + if (exists $links{$lindex}) {
+ + return $lindex;
+ + }
+ + }
+ } while $cwd=~s!/?[^/]+$!!;
+
+ if (length $config{userdir} && exists $links{"$config{userdir}/".lc($link)}) {
+
+Note I handle setting the url; slightly differently.
+Also note that an initial "index" is ignored. I.e. a
+page "A/B/index.html" is treated as "A/B".
+