gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 121 forks source link

[ADD]ed option for command 'new': --with-views-dir #139

Closed mrazicz closed 10 years ago

mrazicz commented 10 years ago

when you initializing new project ('nesta new project_name') with this option, all files from nesta/views/ will be copied to project_name/views/, so you don't have to do this manually.

gma commented 10 years ago

Hi. Cheers for the pull request.

I'd like something a bit more general; a nesta sub command that copies the templates from a theme (either one installed in ./themes, or the default files in the gem) into the views folder. Something like nesta theme:specialise <name>.

The desired behaviour isn't quite as obvious as a recursive copy; you wouldn't want to grab the sitemap.haml and atom.haml files, as any bug fixes/improvements that get made to those templates when the nesta gem is upgraded would be overridden by your local copy.

We should also make sure that we don't clobber files, asking people whether we should overwrite files that already exist in much the same way that Rails and Thor do (I suspect this is the code that does it – https://github.com/erikhuda/thor/blob/master/lib/thor/actions/create_file.rb).

I don't think theme:specialise is a great name, but inspiration is failing me right now…