def write_templated_file content_filename, title content = File.read(src content_filename) write_templated content, content_filename, title end def write_erb erb_filename content = ERB.new(File.read(src erb_filename)).result cut_filename = erb_filename.sub /\.erb$/, '' File.write build(cut_filename), content end def write_templated_erb erb_filename, title = nil content = ERB.new(File.read(src erb_filename), trim_mode: '-').result cut_filename = erb_filename.sub /\.erb$/, '' write_templated content, cut_filename, title end def write_templated content, filename, title = nil File.write build(filename), page_template.result(binding) end