Permalink
Browse files

add support for markdown /<pages>

  • Loading branch information...
1 parent b0fccf2 commit 53d4aacbbc879da30c1c09f11a585a9953fbeb80 @juliend2 committed Jan 26, 2012
Showing with 17 additions and 0 deletions.
  1. +11 −0 index.php
  2. +5 −0 pages/about.md
  3. +1 −0 themes/default/page.php
View
@@ -35,6 +35,17 @@
else {
header("HTTP/1.0 404 Not Found");
}
+ // pages
+ } elseif (preg_match('/^\/([^\.\/]+)/i', $_GET['uri'], $matches)) {
+ $page_file = 'pages/'.$matches[1].'.md';
+ if (file_exists($page_file)) {
+ $page_content = get_html(@file_get_contents($page_file), 'md');
+ $view = "./themes/{$config['theme']}/page.php";
+ include "./themes/{$config['theme']}/layout.php";
+ } else {
+ header("HTTP/1.0 404 Not Found");
+ }
+ // rss
} elseif ($_GET['uri'] == '/rss') {
header("Content-Type: application/rss+xml; charset=utf-8");
include "./themes/{$config['theme']}/rss.php";
View
@@ -0,0 +1,5 @@
+About
+=====
+
+I'm shy, so there's not much to see here. (n///n)
+
View
@@ -0,0 +1 @@
+<?php echo $page_content; ?>

0 comments on commit 53d4aac

Please sign in to comment.