]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
meta: Error if we can't parse dates because Date::Parse is missing
authorSimon McVittie <smcv@debian.org>
Wed, 21 Mar 2018 09:02:21 +0000 (09:02 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 21 Mar 2018 09:33:04 +0000 (09:33 +0000)
You can still use [[!meta name="date" content="..."]] to generate
<meta> tags that are not interpreted, but the common case for
[[!meta date="..."]] is that you want to change the ctime, and that
won't work without Date::Parse.

Signed-off-by: Simon McVittie <smcv@debian.org>
IkiWiki/Plugin/meta.pm

index 4a9852b725a83c3d86b2f1ac67ec84f5b49233e5..cd367da704a2913d7076289eb2f0a81194e20143 100644 (file)
@@ -162,6 +162,9 @@ sub preprocess (@) {
                                error(sprintf(gettext('cannot parse date/time: %s'), $value));
                        }
                }
                                error(sprintf(gettext('cannot parse date/time: %s'), $value));
                        }
                }
+               else {
+                       error $@;
+               }
        }
        elsif ($key eq 'updated') {
                eval q{use Date::Parse};
        }
        elsif ($key eq 'updated') {
                eval q{use Date::Parse};
@@ -174,6 +177,9 @@ sub preprocess (@) {
                                error(sprintf(gettext('cannot parse date/time: %s'), $value));
                        }
                }
                                error(sprintf(gettext('cannot parse date/time: %s'), $value));
                        }
                }
+               else {
+                       error $@;
+               }
        }
 
        if (! defined wantarray) {
        }
 
        if (! defined wantarray) {