feat: list mode 50/page, card mode left-image rows, AI cover generation command
- blog_paginate: 纯列表模式每页 50 条(list_per_page 可调),其余模式仍走 per_page - 图文(card)模式:卡片网格改为左图右文横排,小屏回退竖排;摘要放宽到 100 字 - 新增 covers:generate:复用 AI 设置的 LLM 配置调 /image_generation(默认 image-01), 为无封面文章批量生成封面存入 media cover 集合;支持 --all/--limit/--post/--style/--dry-run - AI 设置页新增图片模型、封面风格两项配置 - 修正 HomeViewModeTest:列表模式为纯标题(不再显示摘要),并断言每页 50 条与图文布局
This commit is contained in:
@@ -39,6 +39,10 @@ if (! function_exists('blog_paginate')) {
|
||||
*/
|
||||
function blog_paginate(\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $query, ?int $perPage = null): \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
{
|
||||
// 纯列表模式每页固定 50 条(标题列表,信息密度高);其余模式走设置。
|
||||
$perPage ??= \App\Blog\Support\HomeViewMode::current() === \App\Blog\Support\HomeViewMode::LIST
|
||||
? (int) blog_setting('list_per_page', 50)
|
||||
: null;
|
||||
$perPage = max(1, (int) ($perPage ?? blog_setting('per_page', config('blog.per_page'))));
|
||||
|
||||
return $query->paginate($perPage)->onEachSide(1)->withQueryString();
|
||||
|
||||
Reference in New Issue
Block a user