Closed willkg closed 10 years ago
It should have two modes:
I'm guessing we should switch between the two with a flag. Maybe you give it an optional directory holding the web files and if you do, it serves it as a compiled_site.
I implemented one that does the compiled_site. It's pretty nice. I'm really happy with it. It handles the case where base_url includes a path. For example, I compile my blog statically and my base_url is bluesock.org/~willkg/blog/ and thus it's a pain in the ass to test the compiled site. I want an explicit base_url so that images and links work correctly in the RSS feed.
What this does is launches a server locally that looks at the static_dir and translates the base_url to the served_url so everything is in the right place. Further it redirects / to the base path.
I haven't implemented the WSGI side of things, yet.
I had an interesting idea. in the do_GET
method, it should staticrender the page before serving it. That way you could run douglas-cmd serve
and then edit your entry and refresh your browser when you want to see a preview without any additional steps.
8eb8494 implements the rerendering idea.
Going to change the scope of this to cover just static rendering side of things and push the WSGI side off to a separate issue.
douglas-cmd serve
should create a server that serves the blog for preview purposes.