config.rb 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Unique header generation
  2. require './lib/unique_head.rb'
  3. # Markdown
  4. set :markdown_engine, :redcarpet
  5. set :markdown,
  6. fenced_code_blocks: true,
  7. smartypants: true,
  8. disable_indented_code_blocks: true,
  9. prettify: true,
  10. strikethrough: true,
  11. tables: true,
  12. with_toc_data: true,
  13. no_intra_emphasis: true,
  14. renderer: UniqueHeadCounter
  15. # Assets
  16. set :css_dir, 'stylesheets'
  17. set :js_dir, 'javascripts'
  18. set :images_dir, 'images'
  19. set :fonts_dir, 'fonts'
  20. # Activate the syntax highlighter
  21. activate :syntax
  22. ready do
  23. require './lib/monokai_sublime_slate.rb'
  24. require './lib/multilang.rb'
  25. end
  26. activate :sprockets
  27. activate :autoprefixer do |config|
  28. config.browsers = ['last 2 version', 'Firefox ESR']
  29. config.cascade = false
  30. config.inline = true
  31. end
  32. # Github pages require relative links
  33. activate :relative_assets
  34. set :relative_links, true
  35. # Build Configuration
  36. configure :build do
  37. # We do want to hash woff and woff2 as there's a bug where woff2 will use
  38. # woff asset hash which breaks things. Trying to use a combination of ignore and
  39. # rewrite_ignore does not work as it conflicts weirdly with relative_assets. Disabling
  40. # the .woff2 extension only does not work as .woff will still activate it so have to
  41. # have both. See https://github.com/slatedocs/slate/issues/1171 for more details.
  42. activate :asset_hash, :exts => app.config[:asset_extensions] - %w[.woff .woff2]
  43. # If you're having trouble with Middleman hanging, commenting
  44. # out the following two lines has been known to help
  45. activate :minify_css
  46. activate :minify_javascript
  47. # activate :gzip
  48. end
  49. # Deploy Configuration
  50. # If you want Middleman to listen on a different port, you can set that below
  51. set :port, 4567
  52. helpers do
  53. require './lib/toc_data.rb'
  54. end