feat: restore sablog browse modes and clean imported HTML
Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,6 +33,18 @@ if (! function_exists('theme')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('blog_paginate')) {
|
||||
/**
|
||||
* Front-end pager: fewer page chips so the sidebar column does not wrap under.
|
||||
*/
|
||||
function blog_paginate(\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $query, ?int $perPage = null): \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
{
|
||||
$perPage = max(1, (int) ($perPage ?? blog_setting('per_page', config('blog.per_page'))));
|
||||
|
||||
return $query->paginate($perPage)->onEachSide(1)->withQueryString();
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('blog_setting')) {
|
||||
/**
|
||||
* 读取博客设置(Setting 表,带缓存)。
|
||||
|
||||
Reference in New Issue
Block a user