Patch for anchor-based change permalinks in recent changes feed

from JasonBlevins
master
Joey Hess 2008-10-17 21:49:55 -04:00
parent 745dc1c62f
commit fdb5da46b0
2 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,8 @@ sub store ($$$) { #{{{
my $change=shift; my $change=shift;
my $page="$config{recentchangespage}/change_".titlepage($change->{rev}); 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 # Optimisation to avoid re-writing pages. Assumes commits never
# change (or that any changes are not important). # change (or that any changes are not important).
@ -175,6 +177,7 @@ sub store ($$$) { #{{{
commitdate => displaytime($change->{when}, "%X %x"), commitdate => displaytime($change->{when}, "%X %x"),
commitdate_raw => scalar localtime($change->{when}), commitdate_raw => scalar localtime($change->{when}),
wikiname => $config{wikiname}, wikiname => $config{wikiname},
permalink => $permalink,
); );
IkiWiki::run_hooks(pagetemplate => sub { IkiWiki::run_hooks(pagetemplate => sub {
shift->(page => $page, destpage => $page, shift->(page => $page, destpage => $page,

View File

@ -3,6 +3,8 @@
[[!meta authorurl="""<TMPL_VAR AUTHORURL>"""]] [[!meta authorurl="""<TMPL_VAR AUTHORURL>"""]]
</TMPL_IF> </TMPL_IF>
[[!meta title="""change to<TMPL_LOOP NAME="PAGES"> <TMPL_VAR PAGE></TMPL_LOOP> on <TMPL_VAR WIKINAME>"""]] [[!meta title="""change to<TMPL_LOOP NAME="PAGES"> <TMPL_VAR PAGE></TMPL_LOOP> on <TMPL_VAR WIKINAME>"""]]
[[!meta permalink="<TMPL_VAR PERMALINK>"]]
<div id="change-<TMPL_VAR REV>" class="metadata">
<div class="metadata"> <div class="metadata">
<span class="desc"><br />Changed pages:</span> <span class="desc"><br />Changed pages:</span>
<span class="pagelinks"> <span class="pagelinks">