You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.2 KiB
PHP
75 lines
2.2 KiB
PHP
<?php
|
|
$filepath = __FILE__;
|
|
require __DIR__.'/../vendor/autoload.php';
|
|
use tildeteam\wiki;
|
|
|
|
$additional_head = "
|
|
<meta property='og:type' content='website'>
|
|
<meta property='og:image' content='https://tilde.team/apple-icon.png'>
|
|
<meta property='og:site_name' content='tilde.team news'>
|
|
";
|
|
|
|
$parser = wiki::factory(true);
|
|
|
|
if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
|
|
|
|
$title = "tilde.team~news";
|
|
$additional_head .= "
|
|
<meta property='og:title' content='$title'>
|
|
<meta property='og:url' content='https://tilde.team{$_SERVER['REQUEST_URI']}'>
|
|
<meta property='og:description' content='tilde.team news'>
|
|
";
|
|
include __DIR__.'/../header.php';
|
|
// render news index ?>
|
|
|
|
<h1>tilde.team news</h1>
|
|
|
|
<p>welcome to the tilde.team news!</p>
|
|
|
|
<p>if you want to contribute, check out the
|
|
<a href="https://tildegit.org/team/site/src/branch/master/news">source</a> and open a PR!
|
|
</p>
|
|
|
|
<p>also available as a <a href="feed.php">feed</a></p>
|
|
|
|
<hr>
|
|
<h3>updates:</h3>
|
|
|
|
<?php
|
|
foreach (array_reverse(glob("pages/*.md")) as $page) {
|
|
$yaml = $parser->parse(file_get_contents($page))->getYAML();
|
|
if (!$yaml["published"]) continue; ?>
|
|
<a href="<?=basename($page, ".md")?>"><?=$yaml["title"]?></a> - <?=$yaml["date"]?><br>
|
|
<?php }
|
|
|
|
} else {
|
|
|
|
$pg = $parser->parse(file_get_contents("pages/{$_GET["page"]}.md"));
|
|
$yml = $pg->getYAML();
|
|
$title = $yml['title'] . " | tilde.team~news";
|
|
$description = $yml['description'] ?? "tilde.team news update {$yml['title']}";
|
|
$additional_head .= "
|
|
<meta property='og:title' content='$title'>
|
|
<meta property='og:url' content='https://tilde.team{$_SERVER['REQUEST_URI']}'>
|
|
<meta property='og:description' content='$description'>
|
|
";
|
|
include __DIR__.'/../header.php';
|
|
// show a single page ?>
|
|
|
|
<a href=".">< ~news</a>
|
|
|
|
<h1><?=$yml["title"]?></h1>
|
|
<p><?=$yml["date"]?> - <a href="/~<?=$yml["author"]?>/">~<?=$yml["author"]?></a></p>
|
|
|
|
<hr>
|
|
<?=$pg->getContent()?>
|
|
<hr>
|
|
|
|
<a href="https://tildegit.org/team/site/src/branch/master/news/pages/<?=$_GET["page"]?>.md">
|
|
<i class="fa fa-edit"></i> source
|
|
</a>
|
|
|
|
<?php }
|
|
|
|
include __DIR__.'/../footer.php';
|