Makzan / I share what I learnt

Configure files to copy without middleman building process

While building the new makzan.net on top of middleman site generator. I faced an issue that for certain files, I don’t want middleman to process it during the build process.

For example, I want to copy the README.md without middleman compiling it into HTML file. I also need to copy my HTML5 gamestweet archive and some other stuff without going through the building process.

So I created a folder named public. Then use the following after_build command in config.rb to copy the files in public into the build folder after every clean build.

1
2
3
after_build do |builder|
  FileUtils.cp_r 'public/.', 'build'
end

Published on September 19, 2015. More articles like this: Web Technologies.

Sign up for weekly dispatch each week.

Want productive tips and web technologies links like this in your inbox each week? No spam ever. Just useful content:

Read previous weekly dispatch newsletters.