2018-06-04 02:18:02 +00:00
|
|
|
<?php
|
|
|
|
require __DIR__.'/../vendor/autoload.php';
|
2018-06-09 00:22:19 +00:00
|
|
|
$additional_head = '
|
|
|
|
<style>
|
|
|
|
a.anchor {
|
|
|
|
display: block;
|
|
|
|
position: relative;
|
|
|
|
top: -250px;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
';
|
2018-06-04 06:18:28 +00:00
|
|
|
include __DIR__.'/../header.php';
|
2018-06-04 02:18:02 +00:00
|
|
|
|
2018-06-04 06:18:28 +00:00
|
|
|
$parser = new Mni\FrontYAML\Parser();
|
2018-06-05 14:53:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
|
|
|
|
// render wiki index ?>
|
2018-06-04 02:18:02 +00:00
|
|
|
|
|
|
|
<h1>tilde.team wiki</h1>
|
|
|
|
|
2018-06-04 06:18:28 +00:00
|
|
|
<p>welcome to the tilde.team wiki!</p>
|
2018-06-04 02:18:02 +00:00
|
|
|
|
2018-06-04 22:14:56 +00:00
|
|
|
<p>if you want to contribute, check out the <a href="https://git.tilde.team/meta/site/src/branch/master/wiki">source!</a></p>
|
2018-06-04 02:18:02 +00:00
|
|
|
|
2018-06-04 06:18:28 +00:00
|
|
|
<hr>
|
|
|
|
<h3>pages:</h3>
|
2018-06-04 02:18:02 +00:00
|
|
|
|
|
|
|
<?php
|
2018-06-04 06:18:28 +00:00
|
|
|
foreach (glob("pages/*.md") as $page) {
|
2018-06-05 14:53:42 +00:00
|
|
|
$yaml = $parser->parse(file_get_contents($page))->getYAML();
|
|
|
|
if (!$yaml["published"]) continue; ?>
|
|
|
|
<a href="/wiki/?page=<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br>
|
2018-06-04 06:18:28 +00:00
|
|
|
|
|
|
|
<?php }
|
|
|
|
|
2018-06-05 14:53:42 +00:00
|
|
|
} else {
|
|
|
|
// show a single page ?>
|
2018-06-07 20:57:47 +00:00
|
|
|
<a href="/wiki/">< ~wiki</a>
|
2018-06-05 14:53:42 +00:00
|
|
|
<hr>
|
2018-06-07 20:57:47 +00:00
|
|
|
<?=$parser->parse(file_get_contents("pages/{$_GET['page']}.md"))->getContent()?>
|
2018-06-05 14:53:42 +00:00
|
|
|
<hr>
|
2018-06-07 20:57:47 +00:00
|
|
|
<a href="https://git.tilde.team/meta/site/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
|
|
|
|
<i class="fa fa-edit"></i> source
|
|
|
|
</a>
|
2018-06-05 14:53:42 +00:00
|
|
|
<?php }
|
2018-06-04 06:18:28 +00:00
|
|
|
|
2018-06-04 02:18:02 +00:00
|
|
|
include __DIR__.'/../footer.php';
|