From: joey Date: Wed, 25 Jul 2007 01:16:53 +0000 (+0000) Subject: * Add a htmlext config option, this can be used to make ikiwiki generate X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/1612dce6bbb050eacf6843b972ffaf9816d724be * Add a htmlext config option, this can be used to make ikiwiki generate html files with a different extension. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index b4c588c3a..e5d1c5c44 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -54,6 +54,7 @@ sub defaultconfig () { #{{{ syslog => 0, wikiname => "wiki", default_pageext => "mdwn", + htmlext => "html", cgi => 0, post_commit => 0, rcs => '', @@ -256,7 +257,7 @@ sub targetpage ($$) { #{{{ sub htmlpage ($) { #{{{ my $page=shift; - return targetpage($page, "html"); + return targetpage($page, $config{htmlext}); } #}}} sub srcfile ($) { #{{{ @@ -466,7 +467,7 @@ sub displaytime ($) { #{{{ sub beautify_url ($) { #{{{ my $url=shift; - $url =~ s!/index.html$!/!; + $url =~ s!/index.$config{htmlext}$!/!; $url =~ s!^$!./!; # Browsers don't like empty links... return $url; diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index eb5067d9f..9636c5f94 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -475,7 +475,7 @@ sub pagefile ($) { #{{{ } #}}} sub htmlfn ($) { #{{{ - return shift().".html"; + return shift().".".$config{htmlext}; } #}}} 1 diff --git a/debian/changelog b/debian/changelog index 486ce16a0..b3310a4e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,10 @@ ikiwiki (2.5) UNRELEASED; urgency=low * Correct some issues with escaped preprocessor directives. * Make the map plugin notice when pages in the map are deleted and update it. + * Add a htmlext config option, this can be used to make ikiwiki generate + html files with a different extension. - -- Joey Hess Tue, 24 Jul 2007 20:58:19 -0400 + -- Joey Hess Tue, 24 Jul 2007 21:11:30 -0400 ikiwiki (2.4) unstable; urgency=low diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup index 12df4507f..a772ca60b 100644 --- a/doc/ikiwiki.setup +++ b/doc/ikiwiki.setup @@ -86,6 +86,8 @@ use IkiWiki::Setup::Standard { # To exclude files matching a regexp from processing. This adds to # the default exclude list. #exclude => qr/*\.wav/, + # To change the extension used for generated html files. + #htmlext => '.htm', # Time format (for strftime) #timeformat => '%c', # Locale to use. Must be a UTF-8 locale. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 0107b36ce..57cdba167 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -245,6 +245,10 @@ configuration options of their own. subdirectory of the wiki. The default is to link to pages in the toplevel directory of the wiki. +* --htmlext html + + Configures the extension used for generated html files. Default is "html". + * --timeformat format Specify how to display the time or date. The format string is passed to the diff --git a/ikiwiki.in b/ikiwiki.in index b8acd61ea..8cec3f5c0 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -49,6 +49,7 @@ sub getconfig () { #{{{ "sslcookie!" => \$config{sslcookie}, "httpauth!" => \$config{httpauth}, "userdir=s" => \$config{userdir}, + "htmlext=s" => \$config{htmlext}, "exclude=s@" => sub { push @{$config{wiki_file_prune_regexps}}, $_[1]; },