diff options
author | http://weakish.pigro.net/ <http://weakish.pigro.net/@web> | 2009-10-01 05:48:09 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2009-10-01 05:48:09 -0400 |
commit | 13940c57736a28803f11c871cada7a6e8734f029 (patch) | |
tree | 33a3716745f95699ba2a73e2005362e3c2bc36c8 | |
parent | d4511f730e1c159f570c8d39eb5a3aa1de7f641a (diff) |
[patch] add an option to determine whether put autoindex pages in repo or not
-rw-r--r-- | doc/plugins/autoindex/discussion.mdwn | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index 82e30aab1..2d6b6f1f0 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -5,3 +5,59 @@ The reason being that I have a lot of directories which need to be autoindexed, but I would prefer if the index files didn't clutter up my git repository. even without that feature the plugin is a great help, thanks + + +------ + +If you just don't want to clutter your git repo, below it's a patch does the following: + +* If you set autoindex_commit to 0 in your ikiwiki.setup file, we *do* place auto-generated markdown files in the **wiki source** but *not* in the **repo** + +* If you set autoindex_commit to 1 (this is the default), auto-generated index files will be put in the repo provided you enabled rcs backend. + +<pre> +--- autoindex.pm.orig 2009-10-01 17:13:51.000000000 +0800 ++++ autoindex.pm 2009-10-01 17:21:09.000000000 +0800 +@@ -17,6 +17,13 @@ + safe => 1, + rebuild => 0, + }, ++ autoindex_commit => { ++ type => 'boolean', ++ default => 1, ++ description => 'commit generated autoindex pages into RCS', ++ safe => 0, ++ rebuild => 0, ++ }, + } + + sub genindex ($) { +@@ -25,7 +32,7 @@ + my $template=template("autoindex.tmpl"); + $template->param(page => $page); + writefile($file, $config{srcdir}, $template->output); +- if ($config{rcs}) { ++ if ($config{rcs} and $config{autoindex_commit}) { + IkiWiki::rcs_add($file); + } + } +@@ -94,13 +101,13 @@ + } + + if (@needed) { +- if ($config{rcs}) { ++ if ($config{rcs} and $config{autoindex_commit}) { + IkiWiki::disable_commit_hook(); + } + foreach my $page (@needed) { + genindex($page); + } +- if ($config{rcs}) { ++ if ($config{rcs} and $config{autoindex_commit}) { + IkiWiki::rcs_commit_staged( + gettext("automatic index generation"), + undef, undef); +</pre> + + +Warning: I guess this patch may work, but I *haven't tested it yet*. -- [[weakish]] |