[RFC] Add "static_flavours_main" config var
"Steve Hoelzer" <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm just getting started with pyblosxom (v1.4.1) and I'm playing with
static rendering. I wanted to generate just one atom file at the root
level instead of having atom files for every category and date page.
That would significantly cut down rendering time, disk space, and FTP
bandwidth.
It seems like a decent way to do this is to introduce a new config
var, "static_flavours_main", that specifies a separate set of flavours
for the main page. If that var is not set in config.py, it should
default to the value of "static_flavours".
Here are the small changes I made to do this.
In config.py, define "static_flavours" and "static_flavours_main":
# What flavours should get generated?
py["static_flavours"] = ["html"]
# Different flavours for main page?
py["static_flavours_main"] = ["html", "atom"]
In pyblosxom.py:
Define "flavoursmain" right after "flavours"
flavours = config.get("static_flavours", ["html"])
flavoursmain = config.get("static_flavours_main", flavours)
And then, after the loop to collect individual entries:
if len(renderme) > 0:
# render the main page in specified flavours
for f in flavoursmain:
renderme.append( ("/index." + f, "") )
Steve
P.S. List admins: I sent a similar e-mail to the list last week, and
it was blocked as too large because I included entire source files.
That old e-mail can be ignored.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/