Sources for music.hcoder.org (using Middleman)
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.

104 lines
2.4KB

  1. ###
  2. # Compass
  3. ###
  4. # Susy grids in Compass
  5. # First: gem install susy
  6. # require 'susy'
  7. # Change Compass configuration
  8. # compass_config do |config|
  9. # config.output_style = :compact
  10. # end
  11. ###
  12. # Page options, layouts, aliases and proxies
  13. ###
  14. # Per-page layout changes:
  15. #
  16. # With no layout
  17. # page "/path/to/file.html", :layout => false
  18. #
  19. # With alternative layout
  20. # page "/path/to/file.html", :layout => :otherlayout
  21. #
  22. # A path which all have the same layout
  23. # with_layout :admin do
  24. # page "/admin/*"
  25. # end
  26. # Proxy (fake) files
  27. # page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
  28. # @which_fake_page = "Rendering a fake page with a variable"
  29. # end
  30. POSTS_PER_PAGE = 10
  31. POSTS = Dir.glob(File.join('source/music-monday/posts', '*.erb')).sort.reverse
  32. div, mod = POSTS.length.divmod POSTS_PER_PAGE
  33. number_pages = div + (mod.zero? ? 0 : 1)
  34. (1..number_pages).each do |page_n|
  35. first_post_number = (page_n - 1) * POSTS_PER_PAGE
  36. proxy "/music-monday/pages/#{page_n}/index.html", "music-monday/page.html", :ignore => true, :locals => {
  37. :current_page => page_n,
  38. :number_pages => number_pages,
  39. :posts => POSTS[first_post_number...first_post_number + POSTS_PER_PAGE]
  40. }
  41. end
  42. proxy "/music-monday/index.html", "music-monday/page.html", :ignore => true, :locals => {
  43. :current_page => 1,
  44. :number_pages => number_pages,
  45. :posts => POSTS[0...POSTS_PER_PAGE]
  46. }
  47. proxy "/music-monday/rss.xml", "music-monday/rss-feed.xml", :ignore => true, :locals => {
  48. :posts => POSTS[0...POSTS_PER_PAGE]
  49. }
  50. ###
  51. # Helpers
  52. ###
  53. # Automatic image dimensions on image_tag helper
  54. # activate :automatic_image_sizes
  55. # Methods defined in the helpers block are available in templates
  56. # helpers do
  57. # def some_helper
  58. # "Helping"
  59. # end
  60. # end
  61. set :css_dir, 'stylesheets'
  62. set :js_dir, 'javascripts'
  63. set :images_dir, 'images'
  64. # Build-specific configuration
  65. configure :build do
  66. # For example, change the Compass output style for deployment
  67. # activate :minify_css
  68. # Minify Javascript on build
  69. # activate :minify_javascript
  70. # Enable cache buster
  71. # activate :cache_buster
  72. # Use relative URLs
  73. # activate :relative_assets
  74. # Compress PNGs after build
  75. # First: gem install middleman-smusher
  76. # require "middleman-smusher"
  77. # activate :smusher
  78. # Or use a different image path
  79. # set :http_path, "/Content/images/"
  80. activate :livereload
  81. end