Graffiti believes we are providing you with just about everything you need to build and design a great site out of the box, but we still want to make it really easy to plug in your own code.
You can extend Chalk by doing the following:
Here is an example that enables the theme developer to quickly add links to a couple of popular bookmarking sites as well as making it very easy for users to email the post to a friend.
[Chalk("shareIt")]
public class ShareIt
{
public string HTML(string message, Post post)
{
return
string.Format(shareItBody,
message,
HttpUtility.HtmlEncode(post.Title), new Macros().FullUrl(post.Url));
}
private static readonly string shareItBody = "HTML TRUNCATED FOR DEMO";
}
After the class is compiled and the assembly is added to your bin directory, you can use it in a post list (index.view/etc) or on a single post view (post.view) with the following format: $shareIt.HTML("Share This Post", $post).
There are a couple of other things to mention about extending Chalk.
You can view an example here.