aboutsummaryrefslogtreecommitdiff
path: root/ikiwiki-comment.in
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-11-25 15:44:34 -0400
committerJoey Hess <joey@kitenet.net>2014-11-25 15:44:34 -0400
commiteb7baeb196703a455221751bda4b10c149b84b53 (patch)
treedf13c66dcdb9046cece0c14c56ae6d7965dd42b8 /ikiwiki-comment.in
parent509370d91ddc4871a60d48dc1dbd95e9a2eaff48 (diff)
downloadikiwiki-eb7baeb196703a455221751bda4b10c149b84b53.tar
ikiwiki-eb7baeb196703a455221751bda4b10c149b84b53.tar.gz
the user might specify a directory, rather than a file, if so just put the comment in the directory
Diffstat (limited to 'ikiwiki-comment.in')
-rwxr-xr-xikiwiki-comment.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/ikiwiki-comment.in b/ikiwiki-comment.in
index ef2751eca..b0cea4a4a 100755
--- a/ikiwiki-comment.in
+++ b/ikiwiki-comment.in
@@ -14,7 +14,9 @@ my $pagefile=shift || usage ();
my $dir=IkiWiki::dirname($pagefile);
$dir="." unless length $dir;
my $page=IkiWiki::basename($pagefile);
-$page=~s/\.[^.]+$//;
+if (! -d $pagefile) {
+ $page=~s/\.[^.]+$//;
+}
IkiWiki::Plugin::comments::checkconfig();
my $comment_num=1 + IkiWiki::Plugin::comments::num_comments($page, $dir);