From: Julien Moutinho Date: Sun, 6 Apr 2014 19:30:49 +0000 (+0200) Subject: add event-$base class X-Git-Url: http://git.cyclocoop.org/?p=ikiwiki%2Fevents.git;a=commitdiff_plain;h=3588bbe03f12e52e6f6619a2167742d05b18aa21 add event-$base class --- diff --git a/events.pm b/events.pm index e06e2ce..dd1ed3e 100644 --- a/events.pm +++ b/events.pm @@ -218,10 +218,13 @@ sub event_of_page ($%) { { class => "tag tag-$class" , link => $link } } @tags; + my $base = IkiWiki::dirname($event); + $base =~ s/[^a-zA-Z0-9-]/_/g; return { hour => $hour , link => $link - , tags => \@tags }; + , tags => \@tags + , base => $base }; } sub events_of_pages ($%) { my ($pages, %params) = @_; @@ -367,7 +370,7 @@ sub preprocess_day (@) { my @tags = map {"".$_->{link}.""} @{$_->{tags}}; - "
  • " + "
  • " . "" . (defined $_->{hour} ? "$_->{hour}" : "") . "$_->{link}" @@ -436,7 +439,7 @@ sub preprocess_month (@) { my @tags = map {"".$_->{link}."
  • "} @{$_->{tags}}; - "" + "" . "" . (defined $_->{hour} ? "$_->{hour}" : "") . "$_->{link}"