X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c96d672810ae524aedf9ffff08dcca773cd9a876..4bce373585d517ccd8c5ead9b4fe38119f16c310:/doc/todo/index.html_allowed.mdwn diff --git a/doc/todo/index.html_allowed.mdwn b/doc/todo/index.html_allowed.mdwn index 9c09eec5a..f5e6f8cd7 100644 --- a/doc/todo/index.html_allowed.mdwn +++ b/doc/todo/index.html_allowed.mdwn @@ -3,7 +3,7 @@ providing the usedirs option for output. The remaining patch, discussed below, concerns wanting to use foo/index.mdwn source files and get an output page name of foo, rather than foo/index. --[[Joey]] -[[tag patch]] +[[!tag patch]] --- @@ -91,16 +91,36 @@ page "A/B/index.html" is treated as "A/B". +++ ikidev/IkiWiki.pm 2007-02-25 15:05:22.328852000 -0800 @@ -192,6 +192,12 @@ return $untainted; - } #}}} + } - +sub titlename($;@) { #{{{ + +sub titlename($;@) { + my $page = shift; + $page =~ s!/index$!!; + return pagetitle(basename($page), @_); - +} #}}} + +} + - sub basename ($) { #{{{ + sub basename ($) { my $file=shift; > This way foo/index gets "foo" as its title, not "index". --Ethan + +I took another swing at this and subverted the dominant paradigm. Here goes: + +
+diff -ru ikiwiki-2.4/IkiWiki.pm ikiwiki/IkiWiki.pm +--- ikiwiki-2.4/IkiWiki.pm 2007-06-26 15:01:57.000000000 -0700 ++++ ikiwiki/IkiWiki.pm 2007-07-25 15:58:00.990749000 -0700 +@@ -239,6 +239,7 @@ + my $type=pagetype($file); + my $page=$file; + $page=~s/\Q.$type\E*$// if defined $type; ++ $page=~s/\/index$// if $page =~ /\/index$/; + return $page; + } + ++ +This just makes it so that all files named foo/index become pages called foo, which is the desired effect. I haven't tested everything so far, so be careful! But you can see it working at http://ikidev.betacantrips.com/one/ again, as before. --Ethan + +[[done]], the indexpages setting enables this.