willkg / douglas

DEAD PROJECT: File based static rendering blog system
Other
2 stars 3 forks source link

implement "douglas-cmd serve" for statically rendered blogs #9

Closed willkg closed 10 years ago

willkg commented 10 years ago

douglas-cmd serve should create a server that serves the blog for preview purposes.

willkg commented 10 years ago

It should have two modes:

  1. serve a compiled_site
  2. serve a dynamic via the WSGI app

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.

willkg commented 10 years ago

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.

willkg commented 10 years ago

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.

willkg commented 10 years ago

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.