forked from team/site
1
0
Fork 0

use title from md instead of filename for page title

This commit is contained in:
Ben Harris 2018-06-08 20:36:52 -04:00
parent e98e9b89c4
commit 31fd8a479b
2 changed files with 20 additions and 15 deletions

View File

@ -14,13 +14,14 @@ a.anchor {
}
</style>
';
include __DIR__.'/../header.php';
$parser = new Mni\FrontYAML\Parser();
if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
$title = "tilde.team~wiki";
include __DIR__.'/../header.php';
// render wiki index ?>
<h1>tilde.team wiki</h1>
@ -41,10 +42,14 @@ foreach (glob("pages/*.md") as $page) {
<?php }
} else {
$pg = $parser->parse(file_get_contents("pages/{$_GET["page"]}.md"));
$title = $pg->getYAML()['title'] . " | tilde.team~wiki";
include __DIR__.'/../header.php';
// show a single page ?>
<a href="/wiki/">&lt; ~wiki</a>
<hr>
<?=$parser->parse(file_get_contents("pages/{$_GET['page']}.md"))->getContent()?>
<?=$pg->getContent()?>
<hr>
<a href="https://git.tilde.team/meta/site/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
<i class="fa fa-edit"></i> source

View File

@ -1,7 +1,7 @@
---
author: ~ben
published: true
title: getting-started
title: getting started
category:
- main
---