Skip to content

Commit

Permalink
#355 Check if modified_time is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Dec 9, 2022
1 parent de47567 commit de0edf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/Format/HTML/ContentPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function generatePage()
'language' => $this->language,
'path' => $this->file->getPath(),
'relative_path' => $this->file->getRelativePath(),
'modified_time' => filemtime($this->file->getPath()),
'modified_time' => $this->file->getPath() ? filemtime($this->file->getPath()) : null,
'markdown' => $this->content,
'request' => $config->getRequest(),
'content' => $this->getPureContent(),
Expand Down
2 changes: 1 addition & 1 deletion templates/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div class="Page__header">
<h1><?= $page['breadcrumbs'] ? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1>
<?php if ($config->getHTML()->showDateModified()) { ?>
<?php if ($config->getHTML()->showDateModified() && $page['modified_time']) { ?>
<span class="ModifiedDate">
<?= Todaymade\Daux\FormatDate::format($config, $page['modified_time']) ?>
</span>
Expand Down

0 comments on commit de0edf1

Please sign in to comment.