lib/generators/jekyll/blog/blog_generator.rb in bloggy-0.1.1 vs lib/generators/jekyll/blog/blog_generator.rb in bloggy-0.2
- old
+ new
@@ -1,23 +1,23 @@
class Jekyll::BlogGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
argument :name, :type => :string, :default => "blog"
def copy_config_file
- copy_file 'config/jekyll/_config.yml.tt', 'config/jekyll/_config.yml'
+ template 'config/jekyll/_config.yml.tt', 'config/jekyll/_config.yml'
copy_file 'config/jekyll/atom.xml.tt', 'config/jekyll/atom.xml'
- copy_file 'config/jekyll/index.html.tt', 'config/jekyll/index.html'
- copy_file 'config/jekyll/_layouts/default.html.tt', 'config/jekyll/_layouts/default.html'
+ template 'config/jekyll/index.html.tt', 'config/jekyll/index.html'
+ template 'config/jekyll/_layouts/default.html.tt', 'config/jekyll/_layouts/default.html'
+ template 'config/jekyll/_layouts/post.html.tt', 'config/jekyll/_layouts/post.html'
copy_file 'config/jekyll/_layouts/page.html.tt', 'config/jekyll/_layouts/page.html'
- copy_file 'config/jekyll/_layouts/post.html.tt', 'config/jekyll/_layouts/post.html'
copy_file 'config/jekyll/_posts/2012-04-25-a-test-post.markdown.tt', 'config/jekyll/_posts/2012-04-25-a-test-post.markdown'
copy_file 'config/jekyll/css/screen.css.tt', 'config/jekyll/css/screen.css'
copy_file 'config/jekyll/css/syntax.css.tt', 'config/jekyll/css/syntax.css'
copy_file 'tasks/new_post.rake.tt', 'lib/tasks/new_post.rake'
copy_file 'tasks/gen.rake.tt', 'lib/tasks/gen.rake'
end
- def create_blog source = 'config/jekyll', destination = 'public/blog'
+ def create_blog source = 'config/jekyll', destination = File.join('public',"#{name}")
options = {
'source' => source,
'destination' => destination
}
source_dir = 'config/jekyll'