X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=blobdiff_plain;f=IkiWiki%2FPlugin%2Fcalendar.pm;h=aeb5f3d294693b93285fac9da87ab2564bd89add;hp=2b87451ce2fc304e300fa62b98276c5bc9dd8b2c;hb=54f600af14bf6dc067ffc30ec6f22d517001fe99;hpb=59277c9b6b6461d7097db12b1ed06c1a6a58ec17 diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 2b87451ce..aeb5f3d29 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -22,7 +22,7 @@ use warnings; use strict; use IkiWiki 3.00; use Time::Local; -use POSIX; +use POSIX (); my $time=time; my @now=localtime($time); @@ -38,6 +38,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, archivebase => { type => "string", @@ -46,6 +47,14 @@ sub getsetup () { safe => 1, rebuild => 1, }, + archive_pagespec => { + type => "pagespec", + example => "posts/* and !*/Discussion", + description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command", + link => 'ikiwiki/PageSpec', + safe => 1, + rebuild => 0, + }, } sub is_leap_year (@) { @@ -155,11 +164,11 @@ sub format_month (@) { # Start producing the month calendar $calendar=< - - $purl - $url - $nurl - + + $purl + $url + $nurl + EOF @@ -303,13 +312,14 @@ sub format_year (@) { add_depends($params{page}, "$archivebase/$nyear", deptype("presence")); # Start producing the year calendar + my $m=$params{months_per_row}-2; $calendar=< - - $purl - $url - $nurl - + + $purl + $url + $nurl + Months