Monday, November 08, 2010 at 12:05 AM.

on updateStaticPagesForPost (adrpost, fldebug=false) {
		<<10/28/01; 3:38:06 PM by JES
			<<New optional parameter: fldebug. Pass in true to run publishing in this thread instead of spawning new threads. Makes it possible to step through publishing code in the script debugger.
		<<9/3/01; 11:23:44 PM by JES
			<<Update the archive page, and possibly the home page and RSS file associated with a given post.
			<<For deleted posts, you need to do something else: First call radio.weblog.publishStaticPage with the dates for the archive page, and then call radio.weblog.publishStaticHomePage if the post was on the home page before being deleted.
	local (adrposts = parentOf (adrpost^));
	local (adrblog = parentOf (adrposts^));
	local (adrprefs = @adrblog^.prefs);
	if radio.weblog.isPostOnHomePage (adrpost) { //publish home page
		if fldebug {
			radio.weblog.publishStaticHomePage (adrblog, true, false)}
		else {
			thread.callScript (@radio.weblog.publishStaticHomePage, {adrblog, true, false})}};
	bundle { //publish archive page
		local (day, month, year, hour, minute, second);
		date.get (adrpost^.when, @day, @month, @year, @hour, @minute, @second);
		local (minDate = date.set (day, month, year, 0, 0, 0));
		local (maxDate = date.set (day, month, year, 23, 59, 59));
		if fldebug {
			radio.weblog.publishStaticPage (adrblog, nil, 1, maxDate, minDate, false)}
		else {
			thread.callScript (@radio.weblog.publishStaticPage, {adrblog, nil, 1, maxDate, minDate, false})}}}
<<bundle //testing
	<<local (adrblog = radio.weblog.init ())
	<<local (adrpost = @adrblog^.posts[sizeOf (adrblog^.posts)])
	<<updateStaticPagesForPost (adrpost, true)

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.