summaryrefslogtreecommitdiff
path: root/config.php
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-02-21 22:10:07 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-02-21 22:10:07 +0000
commitf1b0770740f65e50189cacaa3308a5aaa8be8560 (patch)
tree5573c473dec413457398226eb76667d6491b1e43 /config.php
parentdd60dfd4405813980c6079fa454260063057b0c2 (diff)
Remove un-need stuff
Diffstat (limited to 'config.php')
-rw-r--r--config.php31
1 files changed, 0 insertions, 31 deletions
diff --git a/config.php b/config.php
index 6ec7672..e357577 100644
--- a/config.php
+++ b/config.php
@@ -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));
- },
];