X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a9d7c5453ae0f214f86043381310b81ad358b933..d30a7b12685d44312d89a2a1f7e24bb750556135:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index c01c59ac6..82370f430 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -20,7 +20,7 @@ use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match bestlink htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext urlto targetpage - add_underlay pagetitle titlepage linkpage + add_underlay pagetitle titlepage linkpage newpagefile %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); our $VERSION = 2.00; # plugin interface version, next is ikiwiki version @@ -200,7 +200,7 @@ sub getsetup () { #{{{ }, indexpages => { type => "boolean", - defualt => 0, + default => 0, description => "use page/index.mdwn source files", safe => 1, rebuild => 1, @@ -632,13 +632,26 @@ sub pagename ($) { #{{{ return $page; } #}}} +sub newpagefile ($$) { #{{{ + my $page=shift; + my $type=shift; + + if (! $config{indexpages} || $page eq 'index') { + return $page.".".$type; + } + else { + return $page."/index.".$type; + } +} #}}} + sub targetpage ($$) { #{{{ my $page=shift; my $ext=shift; - if (! $config{usedirs} || $page =~ /^index$/ ) { + if (! $config{usedirs} || $page eq 'index') { return $page.".".$ext; - } else { + } + else { return $page."/index.".$ext; } } #}}}