Repository: getpelican/pelican

Issue:
~/site/ for new site path in pelican-quickstart does not create the site below the user's home directory
Stumbled on a little bit of a surprise when playing around with pelican-quickstart today and tried to make a new site with a path based off my home directory on OS X:

```
$ uname -sr
Darwin 13.0.2
$ pwd
/Users/peri/scratch/bug
$ pelican --version
3.3.0
$ ls ~/tmp
$ pelican-quickstart
Welcome to pelican-quickstart v3.3.0.

This script will help you create a new Pelican-based website.

Please answer the following questions so this script can generate the files
needed by Pelican.


> Where do you want to create your new web site? [.] ~/tmp/newsite
> What will be the title of this web site? New Site
> Who will be the author of this web site? Jamie
> Who will be the author of this web site? Jamie
> What will be the default language of this web site? [en] 
> Do you want to specify a URL prefix? e.g., http://example.com   (Y/n) n
> Do you want to enable article pagination? (Y/n) n
> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) n
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) n
Done. Your new project is available at /Users/peri/scratch/bug/~/tmp/newsite
$ ls ~/tmp/newsite
ls: /Users/peri/tmp/newsite: No such file or directory
$ ls ./~/tmp/newsite/
content     output      pelicanconf.py  publishconf.py
```

I'd expect that providing a path relative to the user's home directory would work and creating a new site in ~/tmp/newsite would not create a new directory named ~ in the current directory.

I think that this is just a matter of calling `os.path.expanduser()` when reading the path in, but I haven't had time to test that. 



Discussion:
Thanks for the detailed write-up, Jamie. Do you think this might be something for which you could help implement an enhancement?

Thanks for reminding me that I filed this, Justin. I had hoped to have the time to put a patch together to address this but other issues have kept me away from it (oh, holidays). I figure this might be a good choice for someone else who wants a small thing to address, but this is absolutely on my todo list.

I actually came across this as well and fixed it on my own without knowing this issue, so I can address this, it's really trivial fix just adding os.path.expanduser.


Resolving patch:
diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py
--- a/pelican/tools/pelican_quickstart.py
+++ b/pelican/tools/pelican_quickstart.py
@@ -186,7 +186,8 @@ def main():
         print('Using project associated with current virtual environment.'
               'Will save to:\n%s\n' % CONF['basedir'])
     else:
-        CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new web site?', answer=str_compat, default=args.path))
+        CONF['basedir'] = os.path.abspath(os.path.expanduser(
+            ask('Where do you want to create your new web site?', answer=str_compat, default=args.path)))
 
     CONF['sitename'] = ask('What will be the title of this web site?', answer=str_compat, default=args.title)
     CONF['author'] = ask('Who will be the author of this web site?', answer=str_compat, default=args.author)


Test patch: