Change URLs for /news to be SEO-friendly

This commit is contained in:
Anton McClure 2020-01-10 04:35:56 +00:00
parent f34b57ab35
commit 183b028998
No known key found for this signature in database
GPG Key ID: DBE1A00217EC6F2B
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ $parser = Tildeverse\Wiki\Parser::factory();
<div class="list-group-item">
<h3 class="list-group-item-heading"><?=$yaml["title"]?></h3>
<em>
<a href="/news/?page=<?=basename($page, ".md")?>">
<a href="/news/<?=basename($page, ".md")?>">
<?=$yaml["date"]?></a> - <a href="/~<?=$yaml["author"]?>/"><?=$yaml["author"]?></a>
</em>
<hr>

View File

@ -44,7 +44,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
foreach (array_reverse(glob("pages/*.md")) as $page) {
$yaml = $parser->parse(file_get_contents($page))->getYAML();
if (!$yaml["published"]) continue; ?>
<a href="?page=<?=basename($page, ".md")?>"><?=$yaml["title"]?></a> - <?=$yaml["date"]?><br>
<a href="<?=basename($page, ".md")?>"><?=$yaml["title"]?></a> - <?=$yaml["date"]?><br>
<?php }
} else {