5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-16 20:33:07 +00:00
cotech-website/scripts/migrate_coop_pages.rb

11 lines
312 B
Ruby
Raw Normal View History

2018-11-09 20:58:42 +00:00
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