lib/creator.rb in nanoc-1.0 vs lib/creator.rb in nanoc-1.0.1

- old
+ new

@@ -101,18 +101,20 @@ end # Read template template_index = nil template_meta = nil + template = a_params[:template] || 'default' begin - template = a_params[:template] || 'default' - template_meta = File.read_file('templates/' + template + '/meta.yaml').eruby + template_meta = File.read_file('templates/' + template + '/meta.yaml') template_index_filename = Dir.glob('templates/' + template + '/index.*')[0] - template_index = File.read_file(template_index_filename).eruby + template_index = File.read_file(template_index_filename) rescue $stderr.puts 'ERROR: no such template' exit end + template_meta = template_meta.eruby + template_index = template_index.eruby # Create index and yaml file FileManager.create_dir 'content' do FileManager.create_dir a_pagename do FileManager.create_file 'index.txt' do