X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/cf74cf7a37a1fa4e02dffc6f3ac580626d183433..227540fd875bfaa6b810c0d7caa346f32d5bd7ce:/IkiWiki/Plugin/calendar.pm diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index dcf2b6d64..5aac95884 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -66,7 +66,8 @@ sub format_month (@) { my %params=@_; my %linkcache; - foreach my $p (pagespec_match_list($params{page}, $params{pages}, + foreach my $p (pagespec_match_list($params{page}, + "creation_year($params{year}) and creation_month($params{month}) and ($params{pages})", # add presence dependencies to update # month calendar when pages are added/removed deptype => deptype("presence"))) { @@ -126,6 +127,7 @@ sub format_month (@) { if (exists $pagesources{"$archivebase/$params{year}/$params{month}"}) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/".$params{month}, + noimageinline => 1, linktext => " $monthname "); } add_depends($params{page}, "$archivebase/$params{year}/$params{month}", @@ -133,6 +135,7 @@ sub format_month (@) { if (exists $pagesources{"$archivebase/$pyear/$pmonth"}) { $purl = htmllink($params{page}, $params{destpage}, "$archivebase/$pyear/$pmonth", + noimageinline => 1, linktext => " \&larr "); } add_depends($params{page}, "$archivebase/$pyear/$pmonth", @@ -140,6 +143,7 @@ sub format_month (@) { if (exists $pagesources{"$archivebase/$nyear/$nmonth"}) { $nurl = htmllink($params{page}, $params{destpage}, "$archivebase/$nyear/$nmonth", + noimageinline => 1, linktext => " \&rarr "); } add_depends($params{page}, "$archivebase/$nyear/$nmonth", @@ -205,8 +209,9 @@ EOF } $calendar.=qq{\t\t}; $calendar.=htmllink($params{page}, $params{destpage}, - $linkcache{"$params{year}/$params{month}/$day"}, - "linktext" => "$day"); + $linkcache{"$params{year}/$params{month}/$day"}, + noimageinline => 1, + "linktext" => "$day"); $calendar.=qq{\n}; } else { @@ -255,18 +260,21 @@ sub format_year (@) { if (exists $pagesources{"$archivebase/$params{year}"}) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}", + noimageinline => 1, linktext => "$params{year}"); } add_depends($params{page}, "$archivebase/$params{year}", deptype("presence")); if (exists $pagesources{"$archivebase/$pyear"}) { $purl = htmllink($params{page}, $params{destpage}, "$archivebase/$pyear", + noimageinline => 1, linktext => "\←"); } add_depends($params{page}, "$archivebase/$pyear", deptype("presence")); if (exists $pagesources{"$archivebase/$nyear"}) { $nurl = htmllink($params{page}, $params{destpage}, "$archivebase/$nyear", + noimageinline => 1, linktext => "\→"); } add_depends($params{page}, "$archivebase/$nyear", deptype("presence")); @@ -293,26 +301,22 @@ EOF my $tag; my $mtag=sprintf("%02d", $month); if ($month == $params{month}) { - if ($pagesources{"$archivebase/$params{year}/$mtag"}) { - $tag = 'this_month_link'; - } - else { - $tag = 'this_month_nolink'; - } + $tag = 'year-calendar-this-month'; } elsif ($pagesources{"$archivebase/$params{year}/$mtag"}) { - $tag = 'month_link'; + $tag = 'year-calendar-month-link'; } elsif ($future_month && $month >= $future_month) { - $tag = 'month_future'; + $tag = 'year-calendar-month-future'; } else { - $tag = 'month_nolink'; + $tag = 'year-calendar-month-nolink'; } if ($pagesources{"$archivebase/$params{year}/$mtag"}) { $murl = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/$mtag", + noimageinline => 1, linktext => "$monthabbr"); $calendar.=qq{\t}; $calendar.=$murl;