5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-22 14:43:07 +00:00
cotech-website/scripts/migrate_coop_pages.rb
2018-11-09 20:58:42 +00:00

11 lines
312 B
Ruby

require_relative 'coop'
require 'erb'
Coop.all.each do |coop|
output_fn = File.join(File.dirname(__FILE__), '..', '_coops', coop.slug + '.md')
renderer = ERB.new(File.read('coop.erb.md'), nil, '<>')
result = renderer.result(coop.erb_binding)
File.open(output_fn, 'w') { |file| file.write(result) }
end