Remove published at element if no date
Errietta Kostala [Fri, 8 Aug 2014 10:57:01 +0000 (11:57 +0100)]
lib/App/SCS/Plugin/Core/PagePlugin/PageData.pm

index a35d2f4..eaa45d2 100644 (file)
@@ -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]')