Skip to content

Description or Excerpt

Phillip Haydon edited this page Jul 29, 2013 · 1 revision

When rendering content on a homepage, or paged content, you can render a excerpt of your content.

The Post model has a ContentExcerpt property:

public string ContentExcerpt
{
    get { return Content.Split(new[] {"<!--excerpt-->"}, StringSplitOptions.None)[0]; }
}

Currently the excerpt code is hard coded, but this will be configurable in the future :)

Simply add the HTML comment to your Markdown file: <!--excerpt--> and when you render the content you can render only the first portion of your post. Handy for paged content and home pages.

public string Content { get; set; }

The content property will simply render the entire Markdown file, as is.