update links for pretty urls

This commit is contained in:
Ben Harris 2019-07-09 00:47:22 -04:00
parent d15fccb3ab
commit a16b452a8d
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
2 changed files with 12 additions and 3 deletions

View File

@ -19,5 +19,14 @@ stop by irc and say hi!
`<bind address="127.0.0.1" port="8081" type="httpd">`
4. add gen_stats to a crontab for a user that can write in the webroot:
`* * * * * /var/www/tilde.chat/gen_stats`
5. `cp blacklist{.example,}`
6. `vim blacklist` - stats gen will fail if this is missing
5. nginx config for pretty urls
```
location ~* ^/wiki/(.+)$ {
try_files $uri $uri/ /wiki/index.php?page=$1;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
```

View File

@ -44,7 +44,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
foreach (glob("pages/*.md") as $page) {
$yaml = $parser->parse(file_get_contents($page))->getYAML();
if (!$yaml["published"]) continue; ?>
<a href="?page=<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br>
<a href="<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br>
<?php }
} else {