Re: Thoughts on static rendering

will kahn-greene <[email protected]> Fri, 01 Apr 2011 10:00:36 -0400
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
On 04/01/2011 09:48 AM, seanh wrote:
> Currently the static rendering docs tell you to write a script that
> deletes old files from static_dir after rendering incrementally, and
> that copies files not rendered by pyblosxom into static_dir. I wonder if
> it might be worth creating a feature request issue to improve static
> rendering. How simple would it be to make pyblosxom handle this
> automatically?
> 
> Add an option config.py setting py["static_files"] that should point to
> a directory containing files not rendered by pyblosxom (images, CSS...)
> that should be copied into static_dir after static rendering.

I think this is interesting and it should be a small change.  So I'm +1
on doing this.  It's worth adding an issue to the tracker and working on
a patch.


> When running `pyblosxom-cmd staticrender` pyblosxom could:
> 
> 1. Recursively delete the contents of static_dir.
> 2. Render blog files into static dir.
> 3. Recursively copy the contents of static_files into static_dir.
> 
> When running `pyblosxom-cmd staticrender --incremental` it would skip
> step 1 and do steps 2 and 3 incrementally. For step 3, recursively walk
> static_files and compare each file to its counterpart in static_dir. If
> the counterpart is older or does not exist, then copy the file over.
> As long as you have only added and modified files then you can just
> render incrementally, if you've deleted files or moved files you'd need
> to render the whole thing again.
> 
> It might be possible to simplify it even more ... If pyblosxom could
> automatically detect when it needs to render the whole thing and just do
> it.

I'm kind of -0 on doing this.  It adds more work and to core maintenance
to save a line or two in a script for a user.

/will

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf