diff options
author | Aaron Parecki <aaron@parecki.com> | 2017-01-06 11:00:34 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2017-01-06 11:00:34 -0800 |
commit | 92615f6183c94c039d7591068768ae21ce6e0b11 (patch) | |
tree | 8eaf8a6a0a25eca5ee5c4a66f0b28cbffabca168 /controllers/static.php | |
parent | bdff359178d6696d1934a3e350d6cd1b33282251 (diff) |
expand documentation
Diffstat (limited to 'controllers/static.php')
-rw-r--r-- | controllers/static.php | 33 |
1 files changed, 29 insertions, 4 deletions
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 @@ <?php +function doc_pages($page=null) { + $pages = [ + 'signing-in' => '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)); }); - |