jbroadway/elefant — pull request #197 by gareththered (2013-06-20 20:48:32+00:00)
Title: Truncated Blog Preview

Truncates the blog preview (on the blog index page) to a configurable number of characters.

The function (truncate) in `TruncateHTML.php` was originally from CakePHP and has been altered a few times over the years. The version used here was downloaded from: http://www.gsdesign.ro/blog/cut-html-string-without-breaking-the-tags. There are few truncating functions out there, but they are all a few years old and have some issues or another. I believe the one used is the most up to date.

It's configured by adding `preview_chars = 300` under `[Blog]` in the blog's `config.php`. On my laptop, a value of 300 shows about 3 lines of blog preview.