Thoughts on static rendering
seanh <[email protected]> Fri, 1 Apr 2011 14:48:13 +0100
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <20110401134813.GB5431@kisimul> |
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. 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. If we did this we should rename the config.py variables as static_files and static_dir are not very clear. I suggest something like static_outdir and static_filesdir. ------------------------------------------------------------------------------ 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