From 173879081a0058541b54267420fc2d2e5685716e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 23 Mar 2021 18:02:20 +0100 Subject: sync with ikiwiki 3.20190207 --- IkiWiki/Plugin/meta.pm | 20 ++++++++++++++++++-- IkiWiki/Plugin/osm.pm | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index ea099f9..cd367da 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -155,14 +155,30 @@ sub preprocess (@) { eval q{use Date::Parse}; if (! $@) { my $time = str2time($value); - $IkiWiki::pagectime{$page}=$time if defined $time; + if (defined $time) { + $IkiWiki::pagectime{$page}=$time; + } + else { + error(sprintf(gettext('cannot parse date/time: %s'), $value)); + } + } + else { + error $@; } } elsif ($key eq 'updated') { eval q{use Date::Parse}; if (! $@) { my $time = str2time($value); - $pagestate{$page}{meta}{updated}=$time if defined $time; + if (defined $time) { + $pagestate{$page}{meta}{updated}=$time; + } + else { + error(sprintf(gettext('cannot parse date/time: %s'), $value)); + } + } + else { + error $@; } } diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm index a5af4ed..27db31a 100644 --- a/IkiWiki/Plugin/osm.pm +++ b/IkiWiki/Plugin/osm.pm @@ -233,7 +233,7 @@ sub get_tag_icon($) { my $tag = shift; # look for an icon attached to the tag my $attached = $tag . '/' . $config{'osm_tag_default_icon'}; - if (srcfile($attached)) { + if (srcfile($attached, 1)) { return $attached; } else { -- cgit v1.2.3