fixed index.php, and added demo and template pages instead of empty linux page

This commit is contained in:
jan6 2021-01-21 04:53:26 +11:00
parent 1d2f440caf
commit f7aebe7847
4 changed files with 51 additions and 17 deletions

View File

@ -40,14 +40,15 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
<hr>
<h3>pages:</h3>
<ul>
<?php
foreach (glob("pages/*.md") as $page) {
$yaml = $parser->parse(file_get_contents($page))->getYAML();
if (!$yaml["published"]) continue; ?>
<li><a href="<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br></li>
<li><a href="<?php echo(strtok($_SERVER["REQUEST_URI"], '?')."?page=".basename($page, ".md"));?>"><?=$yaml["title"]?></a><br></li>
<?php }
echo("</ul></div>");
} else {
$pg = $parser->parse(file_get_contents("pages/{$_GET["page"]}.md"));
@ -73,4 +74,6 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
<?php }
echo("</body></html>");
//include __DIR__.'/../footer.php';
?>

27
pages/demo.md Normal file
View File

@ -0,0 +1,27 @@
---
author: ~jan6
published: true
title: demo
description: just some examples
category:
- main
- demo
---
# demo
you write *text* in **markdown**, and can use [links](./?page=index).
<del>lolz hahaha this suxx0rzz</del> <ins>this is nice!</ins>
* unordered
* * list
* * * shouldn't need to go deeper than 3 levels
0. ordered
993. list
141234343243214324. works with any number and order
2. * also nested unordered lists
0. 0. no ordering inside itself
* nor
* 0. inside unordered list

View File

@ -1,15 +0,0 @@
---
author: ~spider
published: true
title: linux 101
description: basic linux commands
category:
- main
---
# Linux 101
This is a test [link](http://google.com/).
* I don't know
* If this works

19
pages/template.md Normal file
View File

@ -0,0 +1,19 @@
---
author: ~jan6
published: true
title: template page
description: base new pages off of this format
category:
- main
- template
---
# template
you write *text* in **markdown**, and can use links:
* [wiki index](.)
* [demo page](./?page=demo)
> I say, this is an awesome place!
> > Go and make more wiki pages!
>>> (But make sure they're of quality!)