Source: site.view [edit]
Function name: blogRender
Arguments: data
Description: Renders blog content.
Page type: webl
Render function:  
Module: siteutil

Page source:

// Data should be a wubhub object with a title field (string) and an
// entries field (list of entries).  Each entry should have fields:
//   title: the title of the entry
//   when : a date/time string when the entry was created
//   postedby : a username of the author
//   content : a string containing html content of the entry
//   image : html for an <img>.  Insert your own width/height params if desired.


var title = (data.title ? "Blog");
var s = "<H1>" + title + "</H1>\n";

var entries = (data.entries ? data.items ? []);

every entry in entries do
   var title = (entry.title ? entry.label ? "Important news!");
   var content = (entry.content ? entry.desc ? "Missing content field...");
   var postedBy = (("Posted by " + entry.postedby) ? "");
   var where = (entry.addr + "<br>" ? "");
   var grey = (entry.when + "<br>" ? "") + where + postedBy;
   var img = ( entry.image ? "&nbsp;");

   s = s + "\n<hr>\n<H1>" + title + "</H1><table><tr><td><font color=gray>" + grey + "</font></td><td align=right>" + img + "</td></tr></table>"
         +  content
end;

NewPiece(s, "text/html");