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.

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