From 92615f6183c94c039d7591068768ae21ce6e0b11 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 6 Jan 2017 11:00:34 -0800 Subject: expand documentation --- controllers/static.php | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'controllers/static.php') diff --git a/controllers/static.php b/controllers/static.php index c53fa14..6b64df7 100644 --- a/controllers/static.php +++ b/controllers/static.php @@ -1,5 +1,21 @@ 'Signing In', + 'creating-posts' => 'Creating Posts', + 'editor' => 'Rich Editor', + 'note' => 'Note Interface', + 'syndication' => 'Syndication', + 'post-status' => 'Post Status', + ]; + if($page == null) + return $pages; + else + return $pages[$page]; +} + + $app->get('/', function($format='html') use($app) { $res = $app->response(); $params = $app->request()->params(); @@ -23,14 +39,23 @@ $app->get('/creating-a-micropub-endpoint', function() use($app) { }); $app->get('/docs', function() use($app) { - render('docs', array('title' => 'Documentation', 'authorizing' => false)); + render('docs/index', array( + 'title' => 'Documentation', + 'authorizing' => false, + 'pages' => doc_pages() + )); }); -$app->get('/docs/post-status', function() use($app) { - render('docs/post-status', array('title' => 'Post Status Documentation', 'authorizing' => false)); +$app->get('/docs/:page', function($page) use($app) { + if(file_exists('views/docs/'.$page.'.php')) + render('docs/'.$page, array( + 'title' => doc_pages($page).' - Quill Documentation', + 'authorizing' => false + )); + else + $app->notFound(); }); $app->get('/privacy', function() use($app) { render('privacy', array('title' => 'Quill Privacy Policy', 'authorizing' => false)); }); - -- cgit v1.2.3