summaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-29 17:30:30 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-29 17:30:30 -0400
commita9d7c5453ae0f214f86043381310b81ad358b933 (patch)
treea8cb240b4535ce3a1b772d33fe46b56dad5b1086 /IkiWiki.pm
parent1f1867a6fc52daa26b4bfe0aa597df8edee24595 (diff)
Add indexpages option
This is the easy part of supporting foo/index.mdwn sources for page foo. Note that if foo.mdwn exists too, there will be a warning about multiple sources for the same page, and which is used is indeterminate. indexpages should also cause web based editing to create index source pages by default; this and other fallout of the option not yet implemented.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 9b7baa0ee..c01c59ac6 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -198,6 +198,13 @@ sub getsetup () { #{{{
safe => 0, # changing requires manual transition
rebuild => 1,
},
+ indexpages => {
+ type => "boolean",
+ defualt => 0,
+ description => "use page/index.mdwn source files",
+ safe => 1,
+ rebuild => 1,
+ },
discussion => {
type => "boolean",
default => 1,
@@ -619,6 +626,9 @@ sub pagename ($) { #{{{
my $type=pagetype($file);
my $page=$file;
$page=~s/\Q.$type\E*$// if defined $type && !$hooks{htmlize}{$type}{keepextension};
+ if ($config{indexpages} && $page=~/(.*)\/index$/) {
+ $page=$1;
+ }
return $page;
} #}}}