summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/comments.pm14
-rw-r--r--IkiWiki/Plugin/inline.pm1
-rw-r--r--doc/todo/comments.mdwn2
-rw-r--r--templates/comments_display.tmpl2
4 files changed, 8 insertions, 11 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 2ca2d0a1d..3b8752894 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -193,12 +193,10 @@ sub preprocess {
$pagestate{$page}{meta}{title} = $params{subject};
}
- my $baseurl = urlto($params{destpage}, undef, 1);
- my $anchor = "";
if ($params{page} =~ m/\/(\Q$config{comments_pagename}\E\d+)$/) {
- $anchor = $1;
+ $pagestate{$page}{meta}{permalink} = urlto($params{destpage}, undef, 1).
+ "#".$params{page};
}
- $pagestate{$page}{meta}{permalink} = "${baseurl}#${anchor}";
eval q{use Date::Parse};
if (! $@) {
@@ -206,8 +204,6 @@ sub preprocess {
$IkiWiki::pagectime{$page} = $time if defined $time;
}
- # FIXME: hard-coded HTML (although it's just to set an ID)
- return "<div id=\"$anchor\">$content</div>" if $anchor;
return $content;
}
@@ -499,10 +495,8 @@ sub sessioncgi ($$) {
# breaks it or something
error($conflict) if defined $conflict;
- # Bounce back to where we were, but defeat broken caches
- # and jump to the comments anchor.
- my $anticache = "?updated=$page/$config{comments_pagename}$i#comments";
- IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache);
+ # Jump to the new comment on the page.
+ IkiWiki::redirect($cgi, urlto($page, undef, 1)."#$location");
}
else {
IkiWiki::showform ($form, \@buttons, $session, $cgi,
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index d37db97ec..8490b455f 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -340,6 +340,7 @@ sub preprocess_inline (@) {
$template->param(content => $content);
}
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
+ $template->param(inlinepage => $page);
$template->param(title => pagetitle(basename($page)));
$template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));
$template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat}));
diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn
index c81947e74..2bcec69ba 100644
--- a/doc/todo/comments.mdwn
+++ b/doc/todo/comments.mdwn
@@ -81,5 +81,7 @@ Known issues with the [[plugins/comments]] plugin:
with id="comment_123" or something. I'll fix this, unless Joey gets there
first. --[[smcv]]
+ > done --[[Joey]]
+
* Now that inline has some comments-specific functionality anyway, it would
be good to output <link rel="comments"> in Atom and the equivalent in RSS.
diff --git a/templates/comments_display.tmpl b/templates/comments_display.tmpl
index bc4b70273..e7e283bbf 100644
--- a/templates/comments_display.tmpl
+++ b/templates/comments_display.tmpl
@@ -1,4 +1,4 @@
-<div class="comments-display">
+<div class="comments-display" id="<TMPL_VAR NAME=INLINEPAGE>">
<div class="comments-header">
Posted by