You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

  1. <?php
  2. function doc_pages($page=null) {
  3. $pages = [
  4. 'signing-in' => 'Signing In',
  5. 'creating-posts' => 'Creating Posts',
  6. 'editor' => 'Rich Editor',
  7. 'note' => 'Note Interface',
  8. 'syndication' => 'Syndication',
  9. 'post-status' => 'Post Status',
  10. ];
  11. if($page == null)
  12. return $pages;
  13. else
  14. return $pages[$page];
  15. }
  16. $app->get('/', function($format='html') use($app) {
  17. $res = $app->response();
  18. $params = $app->request()->params();
  19. if (k($params, 'me')) {
  20. $app->redirect('/auth/start?'.http_build_query($params), 302);
  21. }
  22. render('index', array(
  23. 'title' => 'Quill',
  24. 'meta' => '',
  25. 'authorizing' => false
  26. ));
  27. });
  28. $app->get('/creating-a-token-endpoint', function() use($app) {
  29. $app->redirect('http://indiewebcamp.com/token-endpoint', 301);
  30. });
  31. $app->get('/creating-a-micropub-endpoint', function() use($app) {
  32. render('creating-a-micropub-endpoint', array('title' => 'Creating a Micropub Endpoint', 'authorizing' => false));
  33. });
  34. $app->get('/docs', function() use($app) {
  35. render('docs/index', array(
  36. 'title' => 'Documentation',
  37. 'authorizing' => false,
  38. 'pages' => doc_pages()
  39. ));
  40. });
  41. $app->get('/docs/:page', function($page) use($app) {
  42. if(file_exists('views/docs/'.$page.'.php'))
  43. render('docs/'.$page, array(
  44. 'title' => doc_pages($page).' - Quill Documentation',
  45. 'authorizing' => false
  46. ));
  47. else
  48. $app->notFound();
  49. });
  50. $app->get('/privacy', function() use($app) {
  51. render('privacy', array('title' => 'Quill Privacy Policy', 'authorizing' => false));
  52. });