2 username="https://www.google.com/accounts/o8/id?id=AItOawnXybLxkPMYpP3yw4b_I6IdC3cKTD-xEdU"
5 date="2011-11-29T00:52:49Z"
7 So I ported the original patch mentioned to the latest Debian version. Well at least the bits that matter to me. See below.
9 In doing so I realized that it does quite work how I imagined it would; instead of generating a dynamic page for a particular day with a list of links it actually fills in the calendar with the details of the posts (making for some ugly formatting).
11 I'm hoping the tag generation pages will give me a clue how to alter this into what I want.
14 diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
15 index c7d2b7c..c931fe6 100644
16 --- a/IkiWiki/Plugin/calendar.pm
17 +++ b/IkiWiki/Plugin/calendar.pm
18 @@ -75,6 +75,8 @@ sub format_month (@) {
24 foreach my $p (pagespec_match_list($params{page},
25 \"creation_year($params{year}) and creation_month($params{month}) and ($params{pages})\",
26 # add presence dependencies to update
27 @@ -88,7 +90,7 @@ sub format_month (@) {
28 my $mtag = sprintf(\"%02d\", $month);
30 # Only one posting per day is being linked to.
31 - $linkcache{\"$year/$mtag/$mday\"} = $p;
32 + $linkcache{\"$year/$mtag/$mday\"}{$p} = $IkiWiki::pagesources{$p};
35 my $pmonth = $params{month} - 1;
36 @@ -219,14 +221,38 @@ EOF
37 $tag='month-calendar-day-this-day';
40 - $tag='month-calendar-day-link';
41 + if ( $detail == 0 ) {
42 + $tag='month-calendar-day-link';
45 + $tag='month-calendar-day';
48 $calendar.=qq{\t\t<td class=\"$tag $downame{$wday}\">};
49 - $calendar.=htmllink($params{page}, $params{destpage},
53 - title => pagetitle(IkiWiki::basename($linkcache{$key})));
54 + if ( $detail == 0 ) {
55 + $calendar.=htmllink($params{page}, $params{destpage},
59 + title => pagetitle(IkiWiki::basename($linkcache{$key})));
62 + my $day_label = qq{<span class=\"month-calendar-day-label\">$day</span>};
63 + $calendar.=qq{$day_label\n};
64 + my $srcpage; my $destpage;
65 + while(($srcpage,$destpage) = each(%{$linkcache{$key}})) {
66 + my $title = IkiWiki::basename(pagename($srcpage));
67 + if (exists $pagestate{$srcpage}{meta}{title} ) {
68 + $title = $pagestate{$srcpage}{meta}{title};
70 + $calendar.=qq{\t\t<div class=\"$tag $downame{$wday}\">};
71 + $calendar.=htmllink($params{page}, $params{destpage},
72 + pagename($destpage),
73 + linktext => $title);
74 + push @list, pagename($linkcache{$key}{$srcpage});
75 + $calendar.=qq{\t\t</div>};
78 $calendar.=qq{</td>\n};