From 34fff64e7b56f4f8cd99430f9f927d2a5d1e3619 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 06:35:52 -0500 Subject: setup file ordering --- IkiWiki/Plugin/calendar.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 2b87451ce..aaee2c610 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -38,6 +38,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, archivebase => { type => "string", -- cgit v1.2.3 From cbf269eee29a66e1350e5553f38eee5b4683be8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 13:10:17 -0400 Subject: audited use POSIX The POSIX perl module exports a huge number of functions by default, so make sure all imports are qualified. (And remove one that was not necessary.) --- IkiWiki.pm | 2 +- IkiWiki/Plugin/calendar.pm | 2 +- IkiWiki/Plugin/relativedate.pm | 2 +- IkiWiki/Plugin/wmd.pm | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index a618836cf..6e333504e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -7,7 +7,7 @@ use strict; use Encode; use HTML::Entities; use URI::Escape q{uri_escape_utf8}; -use POSIX; +use POSIX (); use Storable; use open qw{:utf8 :std}; diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index aaee2c610..ff84bc440 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); diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 06df2efd5..7f006af83 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'redefine'; use strict; use IkiWiki 3.00; -use POSIX; +use POSIX (); use Encode; sub import { diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 5361d2914..99b136281 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -4,7 +4,6 @@ package IkiWiki::Plugin::wmd; use warnings; use strict; use IkiWiki 3.00; -use POSIX; use Encode; sub import { -- cgit v1.2.3 From 3131433f64235ad5425eb93d5773580b607876fb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 13:40:53 -0400 Subject: calendar: Add archive_pagespec, which is used by ikiwiki-calendar to specify which pages to include on the calendar archive pages. (The pagespec can still also be specified on the ikiwiki-calendar command line.) --- IkiWiki/Plugin/calendar.pm | 8 ++++++++ debian/changelog | 4 ++++ doc/ikiwiki-calendar.mdwn | 8 +++++--- doc/ikiwiki/directive/calendar.mdwn | 7 +++++-- ikiwiki-calendar.in | 6 +++++- 5 files changed, 27 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index ff84bc440..0f0e9518a 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -47,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 (@) { diff --git a/debian/changelog b/debian/changelog index 26b00a07c..7c607b2a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,10 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low for master language. * po: Configuring the same language as master and slave confuses processing; so filter out such a misconfiguration. + * calendar: Add archive_pagespec, which is used by ikiwiki-calendar to + specify which pages to include on the calendar archive pages. + (The pagespec can still also be specified on the ikiwiki-calendar command + line.) -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn index 982892fca..c1f4d7267 100644 --- a/doc/ikiwiki-calendar.mdwn +++ b/doc/ikiwiki-calendar.mdwn @@ -16,9 +16,11 @@ You must specify the setup file for your wiki. The pages will be created inside its `srcdir`, beneath the `archivebase` directory used by the calendar plugin (default "archives"). -You will probably want to specify a [[ikiwiki/PageSpec]] -to control which pages are included on the calendars. The -default is all pages. To limit it to only posts in a blog, +To control which pages are included on the calendars, +a [[ikiwiki/PageSpec]] can be specified. The default is +all pages, or the pages specified by the `comments_pagespec` +setting in the config file. A pagespec can also be specified +on the command line. To limit it to only posts in a blog, use something like "posts/* and !*/Discussion". It defaults to creating calendar pages for the current diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn index b2ac75b11..8a08081ee 100644 --- a/doc/ikiwiki/directive/calendar.mdwn +++ b/doc/ikiwiki/directive/calendar.mdwn @@ -40,9 +40,12 @@ An example crontab: "month" or "year". The default is a month view calendar. * `pages` - Specifies the [[ikiwiki/PageSpec]] of pages to link to from the month calendar. Defaults to "*". -* `archivebase` - Configures the base of the archives hierarchy. The - default is "archives". Note that this default can also be overridden +* `archivebase` - Configures the base of the archives hierarchy. + The default is "archives". Note that this default can also be overridden for the whole wiki by setting `archivebase` in ikiwiki's setup file. + Calendars link to pages under here, with names like "2010/04" and + "2010". These pages can be automatically created using the + [[ikiwiki-calendar]] tool. * `year` - The year for which the calendar is requested. Defaults to the current year. * `month` - The numeric month for which the calendar is requested, in the diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in index 9738ea5f7..6b6f693b3 100755 --- a/ikiwiki-calendar.in +++ b/ikiwiki-calendar.in @@ -15,7 +15,7 @@ GetOptions( "force" => \$force, ) || usage(); my $setup=shift || usage(); -my $pagespec=shift || "*"; +my $pagespec=shift; my $startyear=shift || 1900+(localtime(time))[5]; my $endyear=shift || $startyear; @@ -27,6 +27,10 @@ IkiWiki::checkconfig(); my $archivebase = 'archives'; $archivebase = $config{archivebase} if defined $config{archivebase}; +if (! defined $pagespec) { + $pagespec=$config{archive_pagespec} || "*"; +} + sub writearchive ($$;$) { my $template=template(shift); my $year=shift; -- cgit v1.2.3 From 142e025ae471c91e68a23476f700df0b8ad6b31d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 20:12:03 -0400 Subject: calendar: Improved display of arrows. --- IkiWiki/Plugin/calendar.pm | 21 +++++++++++---------- debian/changelog | 1 + doc/plugins/calendar.mdwn | 2 ++ doc/style.css | 8 ++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 0f0e9518a..aeb5f3d29 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -164,11 +164,11 @@ sub format_month (@) { # Start producing the month calendar $calendar=< - - $purl - $url - $nurl - + + $purl + $url + $nurl + EOF @@ -312,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 diff --git a/debian/changelog b/debian/changelog index e4056fdc6..737d73655 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * sidebar: Add global_sidebars setting. * conditional: Fix bug that forced "all" mode off by default. * calendarmonth.tmpl: The month calendar is now put in a sidebar. + * calendar: Improved display of arrows. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index 49fd90627..76e718a3b 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -14,6 +14,7 @@ customization. * `month-calendar` - The month calendar as a whole. * `month-calendar-head` - The head of the month calendar (ie,"March"). +* `month-calendar-arrow` - Arrow pointing to previous/next month. * `month-calendar-day-head` - A column head in the month calendar (ie, a day-of-week abbreviation). * `month-calendar-day-noday`, `month-calendar-day-link`, @@ -27,6 +28,7 @@ customization. weekends. * `year-calendar` - The year calendar as a whole. * `year-calendar-head` - The head of the year calendar (ie, "2007"). +* `year-calendar-arrow` - Arrow pointing to previous/next year. * `year-calendar-subhead` - For example, "Months". * `year-calendar-month-link`, `year-calendar-month-nolink`, `year-calendar-month-future`, `year-calendar-this-month` - The month diff --git a/doc/style.css b/doc/style.css index 44e06ae4f..7ffcf9fe2 100644 --- a/doc/style.css +++ b/doc/style.css @@ -431,3 +431,11 @@ pre.hl { color:#000000; background-color:#ffffff; } /* For the calendar plugin. */ .month-calendar-day-this-day { background-color: #eee; } .year-calendar-this-month { background-color: #eee; } +.month-calendar-arrow A:link, +.year-calendar-arrow A:link, +.month-calendar-arrow A:visited, +.year-calendar-arrow A:visited { + text-decoration: none; + font-weight: normal; + font-size: 150%; +} -- cgit v1.2.3 From 0f778849c6df237f2219de6e1fa237cf2bc9955f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 12:45:21 -0400 Subject: calendar: Allow negative month to be specified. -1 is last month, etc. (And also negaitve years.) --- IkiWiki/Plugin/calendar.pm | 27 +++++++++++++++++++++++---- debian/changelog | 2 ++ doc/ikiwiki/directive/calendar.mdwn | 6 +++--- doc/plugins/calendar/discussion.mdwn | 11 ++++++++++- 4 files changed, 38 insertions(+), 8 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index aeb5f3d29..02f41070e 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -386,8 +386,19 @@ sub preprocess (@) { $params{year} = $thisyear unless defined $params{year}; $params{month} = $thismonth unless defined $params{month}; + my $relativemonth=0; + if ($params{month} < 1) { + $params{month}=$thismonth+$params{month}; + $relativemonth=1; + } + my $relativeyear=0; + if ($params{year} < 1) { + $params{year}=$thisyear+$params{year}; + $relativeyear=1; + } + $params{month} = sprintf("%02d", $params{month}); - + if ($params{type} eq 'month' && $params{year} == $thisyear && $params{month} == $thismonth) { # calendar for current month, updates next midnight @@ -404,8 +415,11 @@ sub preprocess (@) { $pagestate{$params{destpage}}{calendar}{nextchange}= timelocal(0, 0, 0, 1, $params{month}-1, $params{year}); } - elsif ($params{type} eq 'year' && $params{year} == $thisyear) { - # calendar for current year, updates 1st of next month + elsif (($params{type} eq 'year' && $params{year} == $thisyear) || + $relativemonth) { + # Calendar for current year updates 1st of next month. + # Any calendar relative to the current month also updates + # then. if ($thismonth < 12) { $pagestate{$params{destpage}}{calendar}{nextchange}= timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year}); @@ -415,6 +429,12 @@ sub preprocess (@) { timelocal(0, 0, 0, 1, 1-1, $params{year}+1); } } + elsif ($relativeyear) { + # Any calendar relative to the current year updates 1st + # of next year. + $pagestate{$params{destpage}}{calendar}{nextchange}= + timelocal(0, 0, 0, 1, 1-1, $thisyear+1); + } elsif ($params{type} eq 'year' && $params{year} > $thisyear) { # calendar for upcoming year, updates 1st of that year $pagestate{$params{destpage}}{calendar}{nextchange}= @@ -426,7 +446,6 @@ sub preprocess (@) { delete $pagestate{$params{destpage}}{calendar}; } - # Calculate month names for next month, and previous months my $calendar=""; if ($params{type} eq 'month') { $calendar=format_month(%params); diff --git a/debian/changelog b/debian/changelog index f74e9929f..795f02822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low leave passwordauth enabled and let people who don't have an openid use it. The openid selector form avoids the UI annoyance of having both openid and passwordauth on one form. + * calendar: Allow negative month to be specified. -1 is last month, etc. + (And also negaitve years.) -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn index 198da9d51..e9216e11f 100644 --- a/doc/ikiwiki/directive/calendar.mdwn +++ b/doc/ikiwiki/directive/calendar.mdwn @@ -47,14 +47,14 @@ An example crontab: "2010". These pages can be automatically created using the `ikiwiki-calendar` program. * `year` - The year for which the calendar is requested. Defaults to the - current year. + current year. Can also use -1 to refer to last year, and so on. * `month` - The numeric month for which the calendar is requested, in the range 1..12. Used only for the month view calendar, and defaults to the - current month. + current month. Can also use -1 to refer to last month, and so on. * `week_start_day` - A number, in the range 0..6, which represents the day of the week that the month calendar starts with. 0 is Sunday, 1 is Monday, and so on. Defaults to 0, which is Sunday. -* `months_per_row` - In the annual calendar, number of months to place in +* `months_per_row` - In the year calendar, number of months to place in each row. Defaults to 3. [[!meta robots="noindex, follow"]] diff --git a/doc/plugins/calendar/discussion.mdwn b/doc/plugins/calendar/discussion.mdwn index 9d57b7a1e..bb76a9d8b 100644 --- a/doc/plugins/calendar/discussion.mdwn +++ b/doc/plugins/calendar/discussion.mdwn @@ -1,6 +1,15 @@ It would be nice if the "month" type calendar could collect all of the matching pages on a given date in some inline type way. --[[DavidBremner]] +> I agree, but I have not come up with good html to display them. Seems +> it might need some sort of popup. + Is it possible to get the calendar to link to pages based not on their timestamp (as I understand that it does now, or have I misunderstood this?) and instead on for example their location in a directory hierarchy. That way the calendar could be used as a planning / timeline device which I think would be great. --[[Alexander]] -I would like the ability to specify relative previous months. This way I could have a sidebar with the last three months by specifying no month, then 'month="-1"' and 'month="-2"'. Negative numbers for the month would otherwise be invalid, so this shouldn't produce any conflicts with expected behavior. (Right?) -- [[StevenBlack]] +I would like the ability to specify relative previous months. This way I +could have a sidebar with the last three months by specifying no month, +then 'month="-1"' and 'month="-2"'. Negative numbers for the month would +otherwise be invalid, so this shouldn't produce any conflicts with expected +behavior. (Right?) -- [[StevenBlack]] + +> Great idea! Just implemented that and also relative years. --[[Joey]] -- cgit v1.2.3 From fd817f9ac3c074622fe7076516dca61199b09372 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 12:52:19 -0400 Subject: calendar: nextchange calculation bugfix If a page had multiple calendars, the last one won and set nextchange. That's wrong; the calendar that needs to next update soonest should win. --- IkiWiki/Plugin/calendar.pm | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 02f41070e..d43320cac 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -373,6 +373,16 @@ EOF return $calendar; } +sub setnextchange ($$) { + my $page=shift; + my $timestamp=shift; + + if (! exists $pagestate{$page}{calendar}{nextchange} || + $pagestate{$page}{calendar}{nextchange} > $timestamp) { + $pagestate{$page}{calendar}{nextchange}=$timestamp; + } +} + sub preprocess (@) { my %params=@_; @@ -402,18 +412,18 @@ sub preprocess (@) { if ($params{type} eq 'month' && $params{year} == $thisyear && $params{month} == $thismonth) { # calendar for current month, updates next midnight - $pagestate{$params{destpage}}{calendar}{nextchange}=($time + setnextchange($params{destpage}, ($time + (60 - $now[0]) # seconds + (59 - $now[1]) * 60 # minutes + (23 - $now[2]) * 60 * 60 # hours - ); + )); } elsif ($params{type} eq 'month' && (($params{year} == $thisyear && $params{month} > $thismonth) || $params{year} > $thisyear)) { # calendar for upcoming month, updates 1st of that month - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, $params{month}-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, $params{month}-1, $params{year})); } elsif (($params{type} eq 'year' && $params{year} == $thisyear) || $relativemonth) { @@ -421,24 +431,24 @@ sub preprocess (@) { # Any calendar relative to the current month also updates # then. if ($thismonth < 12) { - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year})); } else { - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $params{year}+1); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $params{year}+1)); } } elsif ($relativeyear) { # Any calendar relative to the current year updates 1st # of next year. - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $thisyear+1); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $thisyear+1)); } elsif ($params{type} eq 'year' && $params{year} > $thisyear) { # calendar for upcoming year, updates 1st of that year - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $params{year})); } else { # calendar for past month or year, does not need -- cgit v1.2.3 From d0c17a4a46b48d8513c0167271f2f2eb8b9bc081 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 13:51:05 -0400 Subject: calendar: Display year name in title of month calendar. Also, fix relative month calculations. --- IkiWiki/Plugin/calendar.pm | 21 +++++++++++++-------- debian/changelog | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index d43320cac..0bf933dcd 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -132,12 +132,12 @@ sub format_month (@) { $archivebase = $params{archivebase} if defined $params{archivebase}; # Calculate URL's for monthly archives. - my ($url, $purl, $nurl)=("$monthname",'',''); + my ($url, $purl, $nurl)=("$monthname $params{year}",'',''); if (exists $pagesources{"$archivebase/$params{year}/$params{month}"}) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/".$params{month}, noimageinline => 1, - linktext => $monthname, + linktext => "$monthname $params{year}", title => $monthname); } add_depends($params{page}, "$archivebase/$params{year}/$params{month}", @@ -396,15 +396,20 @@ sub preprocess (@) { $params{year} = $thisyear unless defined $params{year}; $params{month} = $thismonth unless defined $params{month}; - my $relativemonth=0; - if ($params{month} < 1) { - $params{month}=$thismonth+$params{month}; - $relativemonth=1; - } my $relativeyear=0; if ($params{year} < 1) { - $params{year}=$thisyear+$params{year}; $relativeyear=1; + $params{year}=$thisyear+$params{year}; + } + my $relativemonth=0; + if ($params{month} < 1) { + $relativemonth=1; + my $monthoff=$params{month}; + $params{month}=($thismonth+$monthoff) % 12; + $params{month}=12 if $params{month}==0; + my $yearoff=POSIX::ceil(($thismonth-$params{month}) / -12) + - int($monthoff / 12); + $params{year}-=$yearoff; } $params{month} = sprintf("%02d", $params{month}); diff --git a/debian/changelog b/debian/changelog index 795f02822..f47793477 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,7 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low and passwordauth on one form. * calendar: Allow negative month to be specified. -1 is last month, etc. (And also negaitve years.) + * calendar: Display year name in title of month calendar. -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 -- cgit v1.2.3 From 04ff998c51b578017edf369e0dfc2dc7c63d8071 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Jun 2010 15:01:10 -0400 Subject: calendar styling * calendar: Shorten day names, and improve styling of month calendar. * style.css: Reduced sidebar width back to 20ex from 30; the month calendar will now fit in the smaller width, and 30 was feeling too large. --- IkiWiki/Plugin/calendar.pm | 5 +++-- debian/changelog | 9 ++++++--- doc/style.css | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 0bf933dcd..359c9b861 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -123,6 +123,7 @@ sub format_month (@) { } # Find out month names for this, next, and previous months + my $monthabbrev=POSIX::strftime("%b", @monthstart); my $monthname=POSIX::strftime("%B", @monthstart); my $pmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900))); my $nmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900))); @@ -137,7 +138,7 @@ sub format_month (@) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/".$params{month}, noimageinline => 1, - linktext => "$monthname $params{year}", + linktext => "$monthabbrev $params{year}", title => $monthname); } add_depends($params{page}, "$archivebase/$params{year}/$params{month}", @@ -182,7 +183,7 @@ EOF for my $dow ($week_start_day..$week_start_day+6) { my @day=localtime(timelocal(0,0,0,$start_day++,$params{month}-1,$params{year}-1900)); my $downame = POSIX::strftime("%A", @day); - my $dowabbr = POSIX::strftime("%a", @day); + my $dowabbr = substr($downame, 0, 1); $downame{$dow % 7}=$downame; $dowabbr{$dow % 7}=$dowabbr; $calendar.= qq{\t\t$dowabbr\n}; diff --git a/debian/changelog b/debian/changelog index f7810c66f..d66bcab20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100609) unstable; urgency=low +ikiwiki (3.20100610) unstable; urgency=low * creation_day() etc use local time, not gmtime. To match calendars, which use local time. @@ -11,10 +11,13 @@ ikiwiki (3.20100609) unstable; urgency=low * editpage: Avoid storing accidental state changes when previewing pages. * page.tmpl: Add a div around the sidebar, page content, and comments, to aide in styling. - * style.css: Improvements to make floating sidebar fit better on + * style.css: Improvements to make floating sidebar fit much better on pages with inlines. + * calendar: Shorten day names, and improve styling of month calendar. + * style.css: Reduced sidebar width back to 20ex from 30; the month calendar + will now fit in the smaller width, and 30 was feeling too large. - -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 + -- Joey Hess Thu, 10 Jun 2010 14:24:05 -0400 ikiwiki (3.20100518.2) unstable; urgency=low diff --git a/doc/style.css b/doc/style.css index 154729721..2cc467b4f 100644 --- a/doc/style.css +++ b/doc/style.css @@ -199,7 +199,7 @@ div.recentchanges { } .sidebar { - width: 30ex; + width: 20ex; float: right; margin-left: 4px; margin-bottom: 4px; @@ -383,8 +383,17 @@ pre.hl { color:#000000; background-color:#ffffff; } .hl.kwd { color:#010181; } /* calendar plugin */ -.month-calendar-day-this-day { background-color: #eee; } -.year-calendar-this-month { background-color: #eee; } +.month-calendar-day-this-day, +.year-calendar-this-month { + background-color: #eee; +} +.month-calendar-day-head, +.month-calendar-day-nolink, +.month-calendar-day-link, +.month-calendar-day-this-day, +.month-calendar-day-future { + text-align: right; +} .month-calendar-arrow A:link, .year-calendar-arrow A:link, .month-calendar-arrow A:visited, -- cgit v1.2.3 From d541cc854a6e610d2d9f5f7b950f4abb76e36954 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 13:38:19 -0400 Subject: calendar: Tune archive_pagespec to only match pages, not other files. --- IkiWiki/Plugin/calendar.pm | 2 +- auto-blog.setup | 2 +- debian/changelog | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin/calendar.pm') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 359c9b861..bb995d499 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -49,7 +49,7 @@ sub getsetup () { }, archive_pagespec => { type => "pagespec", - example => "posts/* and !*/Discussion", + example => "page(posts/*) and !*/Discussion", description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command", link => 'ikiwiki/PageSpec', safe => 1, diff --git a/auto-blog.setup b/auto-blog.setup index ef03295d6..980074ec3 100644 --- a/auto-blog.setup +++ b/auto-blog.setup @@ -46,7 +46,7 @@ IkiWiki::Setup::Automator->import( example => "blog", comments_pagespec => "posts/* and !*/Discussion", blogspam_pagespec => "postcomment(*)", - archive_pagespec => "posts/* and !*/Discussion", + archive_pagespec => "page(posts/*) and !*/Discussion", global_sidebars => 0, discussion => 0, locked_pages => "*", diff --git a/debian/changelog b/debian/changelog index 32ba0cf08..bddedeafa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * websetup: Allow enabling plugins listed in disable_plugins. * editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) + * calendar: Tune archive_pagespec to only match pages, not other files. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3