From 02ec92c6cb0cfb86fb9a0b65addbd8c0934869c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Oct 2008 21:21:07 -0400 Subject: make relativedate work for the dates on the recentchanges page Having a always current relative date on recentchanges is very, very nice. --- IkiWiki/Plugin/recentchanges.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki/Plugin/recentchanges.pm') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index eb23b184b..d25c7abff 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -173,6 +173,7 @@ sub store ($$$) { #{{{ $template->param( %$change, commitdate => displaytime($change->{when}, "%X %x"), + commitdate_raw => scalar localtime($change->{when}), wikiname => $config{wikiname}, ); IkiWiki::run_hooks(pagetemplate => sub { -- cgit v1.2.3 From fdb5da46b0122d9cb4b2611526c6c955478a80cf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Oct 2008 21:49:55 -0400 Subject: Patch for anchor-based change permalinks in recent changes feed from JasonBlevins --- IkiWiki/Plugin/recentchanges.pm | 3 +++ templates/change.tmpl | 2 ++ 2 files changed, 5 insertions(+) (limited to 'IkiWiki/Plugin/recentchanges.pm') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index d25c7abff..d0e4176ff 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -115,6 +115,8 @@ 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). @@ -175,6 +177,7 @@ sub store ($$$) { #{{{ commitdate => displaytime($change->{when}, "%X %x"), commitdate_raw => scalar localtime($change->{when}), wikiname => $config{wikiname}, + permalink => $permalink, ); IkiWiki::run_hooks(pagetemplate => sub { shift->(page => $page, destpage => $page, diff --git a/templates/change.tmpl b/templates/change.tmpl index 3a1086cf0..6647dfbca 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -3,6 +3,8 @@ [[!meta authorurl=""""""]] [[!meta title="""change to on """]] +[[!meta permalink=""]] +