example.conf.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Example configuration file for Sami;
  4. * @see Sami website for details on this
  5. */
  6. use Sami\Sami;
  7. use Sami\RemoteRepository\GitHubRemoteRepository;
  8. use Sami\Version\GitVersionCollection;
  9. use Symfony\Component\Finder\Finder;
  10. // Import markdown
  11. require "SamiTwigExtension.php";
  12. $iterator = Finder::create()
  13. ->files()
  14. /**
  15. * For those who clone this into their project,
  16. * we'll exclude sami-markdown to be rendered.
  17. */
  18. ->exclude("sami-markdown")
  19. ->name('*.php')
  20. ->in($dir = './')
  21. ;
  22. /*$versions = GitVersionCollection::create($dir)
  23. ->add('master', 'master branch')
  24. ;
  25. */
  26. $s = new Sami($iterator, array(
  27. 'theme' => 'markdown',
  28. 'template_dirs' => array( __DIR__ . '/'),
  29. //'versions' => $versions,
  30. 'title' => 'Sami Markdown Extension',
  31. 'build_dir' => __DIR__.'/build/%version%',
  32. 'cache_dir' => __DIR__.'/cache/%version%',
  33. ));
  34. // Add extension
  35. $s["twig"]->addExtension(new Markdown\SamiTwigExtension());
  36. return $s;
  37. ?>