diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-10-17 21:54:42 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-10-17 21:54:42 -0400 |
commit | 35c56622ea56c7d97299faba5e72b5a67fa25c66 (patch) | |
tree | 1611695ae2367c2321e8df957781f44ef17f345d | |
parent | fdb5da46b0122d9cb4b2611526c6c955478a80cf (diff) |
tweak recentchanges permalink code
Need to handle the case where url is not set.
-rw-r--r-- | IkiWiki/Plugin/recentchanges.pm | 7 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/bugs/recentchanges_feed_links.mdwn | 2 | ||||
-rw-r--r-- | templates/change.tmpl | 2 |
4 files changed, 10 insertions, 3 deletions
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 <joeyh@debian.org> 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: >>>>>> <http://pastie.org/295016>. >>>>>> --[[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="""<TMPL_VAR AUTHORURL>"""]] </TMPL_IF> [[!meta title="""change to<TMPL_LOOP NAME="PAGES"> <TMPL_VAR PAGE></TMPL_LOOP> on <TMPL_VAR WIKINAME>"""]] +<TMPL_IF PERMALINK> [[!meta permalink="<TMPL_VAR PERMALINK>"]] +</TMPL_IF> <div id="change-<TMPL_VAR REV>" class="metadata"> <div class="metadata"> <span class="desc"><br />Changed pages:</span> |