From: Errietta Kostala Date: Fri, 8 Aug 2014 10:57:01 +0000 (+0100) Subject: Remove published at element if no date X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d347b8dd827ef02957b9e7002620de96b39e9a5b;p=scpubgit%2FApp-SCS.git Remove published at element if no date --- diff --git a/lib/App/SCS/Plugin/Core/PagePlugin/PageData.pm b/lib/App/SCS/Plugin/Core/PagePlugin/PageData.pm index a35d2f4..eaa45d2 100644 --- a/lib/App/SCS/Plugin/Core/PagePlugin/PageData.pm +++ b/lib/App/SCS/Plugin/Core/PagePlugin/PageData.pm @@ -18,7 +18,11 @@ sub filter_content_zoom { ? $_[0]->replace_content($page->subtitle) : $_[0]->replace('') }} - ->select('.page.published_at')->replace_content($page->published_at) + ->select('.page.published_at')->${\sub { + $page->published_at + ? $_[0]->replace_content($page->published_at) + : $_[0]->replace('') + }} ->select('meta[name=description]') ->set_attribute(content => $page->description) ->select('meta[name=keywords]')