Fixes for @tomasino's requested changes
continuous-integration/drone/pr Build encountered an error
Details
continuous-integration/drone/pr Build encountered an error
Details
This commit is contained in:
parent
9caa98af17
commit
9676578b5b
|
@ -20,9 +20,17 @@ if (file_exists($filename)) {
|
||||||
$yml = $document->getYAML();
|
$yml = $document->getYAML();
|
||||||
$content = $document->getContent();
|
$content = $document->getContent();
|
||||||
$title = $yml["title"] ?? "invalid";
|
$title = $yml["title"] ?? "invalid";
|
||||||
$author_name = htmlspecialchars($yml["author-name"]);
|
$date = htmlspecialchars($yml["date"]);
|
||||||
$author_link = htmlspecialchars($yml["author-link"]);
|
$author_name = htmlspecialchars($yml["author_name"]);
|
||||||
$original_link = htmlspecialchars($yml["original"]);
|
if (isset($yml["author_link"])) {
|
||||||
|
$author_link = htmlspecialchars($yml["author_link"]);
|
||||||
|
$author = "<a href=\"$author_link\">$author_name</a>";
|
||||||
|
} else {
|
||||||
|
$author = $author_name;
|
||||||
|
}
|
||||||
|
if (isset($yml["original_link"])):
|
||||||
|
$original_link = htmlspecialchars($yml["original_link"]);
|
||||||
|
endif;
|
||||||
$description = "journal entry {$entry_name}: {$yml["title"]} by {$author}";
|
$description = "journal entry {$entry_name}: {$yml["title"]} by {$author}";
|
||||||
|
|
||||||
include __DIR__."/../header.php";
|
include __DIR__."/../header.php";
|
||||||
|
@ -31,16 +39,16 @@ if (file_exists($filename)) {
|
||||||
<a href=".">< back to list</a>
|
<a href=".">< back to list</a>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
<?=$yml["title"]?>
|
<?=$title?>
|
||||||
<?=$yml["published"] ? "" : " <small><em>draft</em></small>" ?>
|
<?=$yml["published"] ? "" : " <small><em>draft</em></small>" ?>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p>author: <a href="<?=$author_link?>"><?=$author_name?></a></p>
|
<p>author: <?=$author?></p>
|
||||||
<p>date: <?=$yml["date"]?></p>
|
<p>date: <?=$date?></p>
|
||||||
<br />
|
|
||||||
<?php if ($yml["original"]): ?>
|
|
||||||
<p>Originally published at <a href="<?=$original_link?>"><?=$original_link?></a>.</p>
|
|
||||||
<br />
|
<br />
|
||||||
|
<?php if (isset($original_link)): ?>
|
||||||
|
<p>Originally published at <a href="<?=$original_link?>"><?=$original_link?></a>.</p>
|
||||||
|
<br />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?=$content?>
|
<?=$content?>
|
||||||
|
@ -61,11 +69,22 @@ if (file_exists($filename)) {
|
||||||
<h1>journal entries</h1>
|
<h1>journal entries</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($entries as $entry) {
|
<?php foreach ($entries as $entry) {
|
||||||
if (!$entry["yml"]["published"]) continue; ?>
|
if (!$entry["yml"]["published"]) continue;
|
||||||
|
$title = $entry["yml"]["title"] ?? "invalid";
|
||||||
|
$date = htmlspecialchars($entry["yml"]["date"]);
|
||||||
|
$author_name = htmlspecialchars($entry["yml"]["author_name"]);
|
||||||
|
if (isset($entry["yml"]["author_link"])) {
|
||||||
|
$author_link = htmlspecialchars($entry["yml"]["author_link"]);
|
||||||
|
$author = "<a href=\"$author_link\">$author_name</a>";
|
||||||
|
} else {
|
||||||
|
$author = $author_name;
|
||||||
|
} ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="/entries/<?=$entry["slug"]?>"><?=$entry["yml"]["title"]?></a>
|
<a href="/entries/<?=$entry["slug"]?>"><?=$title?></a>
|
||||||
by
|
by
|
||||||
<a href="<?=$entry["yml"]["author-link"]?>"><?=$entry["yml"]["author-name"]?></a>
|
<?=$author?>
|
||||||
|
—
|
||||||
|
<?=$date?>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue