diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2020-02-21 22:10:07 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2020-02-21 22:10:07 +0000 |
| commit | f1b0770740f65e50189cacaa3308a5aaa8be8560 (patch) | |
| tree | 5573c473dec413457398226eb76667d6491b1e43 /config.php | |
| parent | dd60dfd4405813980c6079fa454260063057b0c2 (diff) | |
Remove un-need stuff
Diffstat (limited to 'config.php')
| -rw-r--r-- | config.php | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -36,35 +36,4 @@ return [ 'allCategories' => function ($page, $allPosts) { return $allPosts->pluck('categories')->flatten()->unique(); }, - - 'getExcerpt' => function ($page, $length = 255) { - if ($page->excerpt) { - return $page->excerpt; - } - - $content = preg_split('/<!-- more -->/m', $page->getContent(), 2); - $cleaned = trim( - strip_tags( - preg_replace(['/<pre>[\w\W]*?<\/pre>/', '/<h\d>[\w\W]*?<\/h\d>/'], '', $content[0]), - '<code>' - ) - ); - - if (count($content) > 1) { - return $content[0]; - } - - $truncated = substr($cleaned, 0, $length); - - if (substr_count($truncated, '<code>') > substr_count($truncated, '</code>')) { - $truncated .= '</code>'; - } - - return strlen($cleaned) > $length - ? preg_replace('/\s+?(\S+)?$/', '', $truncated) . '...' - : $cleaned; - }, - 'isActive' => function ($page, $path) { - return Str::endsWith(trimPath($page->getPath()), trimPath($path)); - }, ]; |
