routes.php 732 B

12345678910111213141516171819202122232425
  1. <?php
  2. require_once __DIR__.'/libraries/markdown.php';
  3. View::composer('docs::template', function($view)
  4. {
  5. Asset::add('stylesheet', 'css/style.css');
  6. Asset::add('modernizr', 'js/modernizr-2.5.3.min.js');
  7. Asset::container('footer')->add('prettify', 'js/prettify.js');
  8. $view->with('sidebar', Markdown(file_get_contents(path('storage').'documentation/contents.md')));
  9. });
  10. Route::get('(:bundle)', function()
  11. {
  12. return View::make('docs::home');
  13. });
  14. Route::get('docs/(:any)/(:any?)', function($section, $page = null)
  15. {
  16. $page = rtrim(implode('/', array($section, $page)), '/').'.md';
  17. $content = Markdown(file_get_contents(path('storage').'documentation/'.$page));
  18. return View::make('docs::page')->with('content', $content);
  19. });