Skip to content

Commit 9a8f8bc

Browse files
committed
Fixes #354
1 parent 1b1436d commit 9a8f8bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libs/Format/HTML/ContentPage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function generatePage()
8282
'filename' => $this->file->getName(),
8383
'language' => $this->language,
8484
'path' => $this->file->getPath(),
85-
'relative_path' => $this->file->getRelativePath(),
85+
'relative_path' => $this->file->getPath() ? $this->file->getRelativePath() : null,
8686
'modified_time' => $this->file->getPath() ? filemtime($this->file->getPath()) : null,
8787
'markdown' => $this->content,
8888
'request' => $config->getRequest(),

templates/content.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<?php } ?>
1111
<?php
1212
$edit_on = $config->getHTML()->getEditOn();
13-
if ($edit_on) { ?>
13+
if ($edit_on && $page['relative_path']) { ?>
1414
<span class="EditOn">
1515
<a href="<?= $edit_on['basepath'] ?>/<?= $page['relative_path'] ?>" target="_blank">
1616
<?= str_replace(":name:", $edit_on['name'], $this->translate("Edit_on")) ?>

0 commit comments

Comments
 (0)