2018-08-30 05:40:29 +00:00
|
|
|
<?php
|
|
|
|
require __DIR__.'/../vendor/autoload.php';
|
2021-03-20 17:14:16 +00:00
|
|
|
use tildeteam\wiki;
|
2019-07-03 05:11:55 +00:00
|
|
|
|
2018-08-30 05:40:29 +00:00
|
|
|
$additional_head = "
|
|
|
|
<style>
|
|
|
|
:target:before {
|
|
|
|
content:\"\";
|
|
|
|
display:block;
|
|
|
|
height:90px; /* fixed header height*/
|
|
|
|
margin:-90px 0 0; /* negative fixed header height */
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<meta property='og:type' content='website'>
|
|
|
|
<meta property='og:site_name' content='tilde.chat wiki'>
|
|
|
|
";
|
|
|
|
|
2021-03-20 17:14:16 +00:00
|
|
|
$parser = wiki::factory();
|
|
|
|
wiki::$bootstrap = wiki::$forkawesome = true;
|
2018-08-30 05:40:29 +00:00
|
|
|
|
|
|
|
if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
|
|
|
|
|
|
|
|
$title = "tilde.chat~wiki";
|
|
|
|
$additional_head .= "
|
|
|
|
<meta property='og:title' content='$title'>
|
|
|
|
<meta property='og:url' content='https://tilde.chat{$_SERVER['REQUEST_URI']}'>
|
|
|
|
<meta property='og:description' content='tilde.chat wiki'>
|
|
|
|
";
|
|
|
|
include __DIR__.'/../header.php';
|
|
|
|
// render wiki index ?>
|
|
|
|
|
|
|
|
<h1>tilde.chat wiki</h1>
|
|
|
|
|
|
|
|
<p>welcome to the tilde.chat wiki!</p>
|
|
|
|
|
|
|
|
<p>if you want to contribute, check out the
|
2018-10-15 22:29:34 +00:00
|
|
|
<a href="https://tildegit.org/tildeverse/tilde.chat/src/branch/master/wiki">source</a> and open a PR!
|
2018-08-30 05:40:29 +00:00
|
|
|
</p>
|
2019-12-06 15:40:55 +00:00
|
|
|
<p>commits to master will be automatically deployed</p>
|
2018-08-30 05:40:29 +00:00
|
|
|
|
|
|
|
<hr>
|
|
|
|
<h3>pages:</h3>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
foreach (glob("pages/*.md") as $page) {
|
|
|
|
$yaml = $parser->parse(file_get_contents($page))->getYAML();
|
|
|
|
if (!$yaml["published"]) continue; ?>
|
2019-07-09 04:47:22 +00:00
|
|
|
<a href="<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br>
|
2018-08-30 05:40:29 +00:00
|
|
|
<?php }
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$pg = $parser->parse(file_get_contents("pages/{$_GET["page"]}.md"));
|
|
|
|
$yml = $pg->getYAML();
|
|
|
|
$title = $yml['title'] . " | tilde.chat~wiki";
|
|
|
|
$description = $yml['description'] ?? "tilde.chat wiki article {$yml['title']}";
|
|
|
|
$additional_head .= "
|
|
|
|
<meta property='og:title' content='$title'>
|
|
|
|
<meta property='og:url' content='https://tilde.chat{$_SERVER['REQUEST_URI']}'>
|
|
|
|
<meta property='og:description' content='$description'>
|
|
|
|
";
|
|
|
|
include __DIR__.'/../header.php';
|
|
|
|
// show a single page ?>
|
|
|
|
|
|
|
|
<a href=".">< ~wiki</a>
|
|
|
|
|
|
|
|
<hr>
|
2019-07-03 05:11:55 +00:00
|
|
|
<?=$pg->getContent()?>
|
2018-08-30 05:40:29 +00:00
|
|
|
<hr>
|
2018-10-15 22:29:34 +00:00
|
|
|
<a href="https://tildegit.org/tildeverse/tilde.chat/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
|
2018-08-30 05:40:29 +00:00
|
|
|
<i class="fa fa-edit"></i> source
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<?php }
|
|
|
|
|
|
|
|
include __DIR__.'/../footer.php';
|