Backport fixes from personal site

This commit is contained in:
Ubergeek 2019-07-01 00:32:30 +00:00
parent d28a0b3e6e
commit 7d6b375b59
4 changed files with 31 additions and 12 deletions

View File

@ -1,5 +1,5 @@
RewriteEngine On RewriteEngine On
RewriteRule ^$ main [QSA] RewriteRule ^$ main [QSA]
RewriteRule ^index\.php$ wiki.php [QSA] RewriteRule ^index\.php$ wiki.php?page=main [QSA]
RewriteCond %{REQUEST_URI} !^/includes/site.css RewriteCond %{REQUEST_URI} !(/includes/|/media)
RewriteRule ^([^\d]+)/?$ wiki.php?page=$1 [QSA] RewriteRule ^([^\d]+)/?$ wiki.php?page=$1 [QSA]

11
config.php Normal file
View File

@ -0,0 +1,11 @@
<?php
//Name of your site
$site_name="Thunix Wiki";
//Root for the site, in a browser
$site_root="/";
//Local base root for app files
$doc_root="/var/www/wiki.thunix.net/";
?>

5
includes/older_site.css Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
<?php <?php
include('config.php');
$page = $_GET['page']; $page = $_GET['page'];
if ( $page == "") { if ( $page == "") {
@ -9,27 +11,28 @@ if ( $page == "") {
print "<!DOCTYPE html> print "<!DOCTYPE html>
<html lang='en'> <html lang='en'>
<head> <head>
<title>Thunix Wiki - $page</title> <title>$site_name - $page</title>
<link rel='stylesheet' type='text/css' href='/includes/site.css'> <link rel='stylesheet' type='text/css' href='$site_root/includes/site.css'>
</head> </head>
<body>"; <body>";
echo ( shell_exec("/usr/bin/pandoc includes/header.md") ); echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/header.md") );
print "<hr> print "<hr/>
<div id='body' style='width: 90%;'> <div id='body' style='width: 90%;'>
<div id='sidebar' style='width: 20%;float:left;'>"; <div id='sidebar' style='width: 20%;float:left;'>";
echo ( shell_exec("/usr/bin/pandoc includes/sidebar.md") ); echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/sidebar.md") );
print " </div> print " </div>
<div id='content' style='width: 78%; float:right;'>"; <div id='content' style='width: 80%; float:right;'>";
echo ( shell_exec("/usr/bin/pandoc articles/$page.md") ); echo ( shell_exec("/usr/bin/pandoc $doc_root/articles/$page.md") );
print " </div> print " </div>
</div><hr> </div>
<div id='footer' style='clear:both;'>"; <div id='footer' style='clear:both;'>
<hr/>";
echo ( shell_exec("/usr/bin/pandoc includes/footer.md") ); echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/footer.md") );
print " </div> print " </div>
</body> </body>