From: Joey Hess Date: Sat, 18 Oct 2008 01:54:42 +0000 (-0400) Subject: tweak recentchanges permalink code X-Git-Tag: 2.68~188 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35c56622ea56c7d97299faba5e72b5a67fa25c66;p=ikiwiki.git tweak recentchanges permalink code Need to handle the case where url is not set. --- diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index d0e4176ff..e124a4540 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -115,8 +115,6 @@ sub store ($$$) { #{{{ my $change=shift; my $page="$config{recentchangespage}/change_".titlepage($change->{rev}); - my $baseurl = IkiWiki::baseurl(); - my $permalink="$baseurl$config{recentchangespage}/#change-".titlepage($change->{rev}); # Optimisation to avoid re-writing pages. Assumes commits never # change (or that any changes are not important). @@ -177,8 +175,11 @@ sub store ($$$) { #{{{ commitdate => displaytime($change->{when}, "%X %x"), commitdate_raw => scalar localtime($change->{when}), wikiname => $config{wikiname}, - permalink => $permalink, ); + + $template->param(permalink => $config{url}."$config{recentchangespage}/#change-".titlepage($change->{rev})) + if exists $config{url}; + IkiWiki::run_hooks(pagetemplate => sub { shift->(page => $page, destpage => $page, template => $template, rev => $change->{rev}); diff --git a/debian/changelog b/debian/changelog index 908eb1f53..113a8a504 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ikiwiki (2.68) UNRELEASED; urgency=low move it to toggle.js in the javascript underlay. * relativedate: New javascript-alicious plugin that makes all dates display relative, in a very nice way, if I say so myself. + * recentchanges: Make feed links point back to anchors on the recentchanges + page. (JasonBlevins) -- Joey Hess Fri, 17 Oct 2008 20:11:02 -0400 diff --git a/doc/bugs/recentchanges_feed_links.mdwn b/doc/bugs/recentchanges_feed_links.mdwn index 9b2828901..e3557a6cb 100644 --- a/doc/bugs/recentchanges_feed_links.mdwn +++ b/doc/bugs/recentchanges_feed_links.mdwn @@ -96,3 +96,5 @@ to turn on? --Chapman Flack >>>>>> Here's my attempt at a [[patch]] for anchor-based change permalinks: >>>>>> . >>>>>> --[[JasonBlevins]], 2008-10-17 + +[[done]] diff --git a/templates/change.tmpl b/templates/change.tmpl index 6647dfbca..c9e1a60d6 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -3,7 +3,9 @@ [[!meta authorurl=""""""]] [[!meta title="""change to on """]] + [[!meta permalink=""]] +