feat: topbar legacy-sync button, card view mode with cover fallback, year/month/day archives, richer page cache admin, stylevar repeater editor
Build and Deploy / verify (push) Successful in 32s
Build and Deploy / deploy (push) Successful in 17s

- topbar: Livewire LegacySyncButton next to 写文章 (moved from user menu)
- view modes: add 图文(card) grid with cover fallback chain (cover → attachment → first content image → placeholder); list mode now title-only compact
- archives: year/month/day index grid
- page cache admin: size + expiry columns, total size, cache policy note
- theme inject: stylevars switch from KeyValue to Repeater with multi-line HTML editing
- import: html_entity_decode for category/post-title/link/keywords/comment author
This commit is contained in:
2026-10-13 09:01:46 +00:00
parent 2d8752f863
commit 16dac8b568
24 changed files with 608 additions and 136 deletions
+5 -3
View File
@@ -215,6 +215,7 @@ class SablogImport extends Command
{
$count = 0;
foreach ($this->rows('categories') as $row) {
$row['name'] = html_entity_decode((string) $row['name'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$slug = SlugGenerator::make($row['name'], 'categories', 'slug', ignoreId: (int) $row['cid'], fallback: 'category-'.$row['cid']);
DB::table('categories')->updateOrInsert(['id' => (int) $row['cid']], [
'name' => $row['name'],
@@ -291,7 +292,7 @@ class SablogImport extends Command
DB::table('posts')->updateOrInsert(['id' => (int) $row['articleid']], [
'category_id' => $categoryId,
'user_id' => (int) $row['uid'] ?: null,
'title' => $row['title'],
'title' => html_entity_decode((string) $row['title'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'slug' => $slug,
'excerpt' => $row['description'] ?: null,
'content' => $row['content'],
@@ -323,6 +324,7 @@ class SablogImport extends Command
// 而不是 sablog_tags.aids(那个映射是错的/过时的)
foreach ($this->rows('articles') as $row) {
$keywords = trim((string) ($row['keywords'] ?? ''));
$keywords = html_entity_decode($keywords, ENT_QUOTES | ENT_HTML5, 'UTF-8');
if ($keywords === '') {
continue;
}
@@ -371,7 +373,7 @@ class SablogImport extends Command
foreach ($this->rows('comments') as $row) {
DB::table('comments')->updateOrInsert(['id' => (int) $row['commentid']], [
'post_id' => (int) $row['articleid'],
'author_name' => $row['author'] ?: '匿名',
'author_name' => html_entity_decode((string) ($row['author'] ?: '匿名'), ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'author_url' => $row['url'] ?: null,
'content' => $row['content'],
'ip' => $row['ipaddress'] ?: null,
@@ -389,7 +391,7 @@ class SablogImport extends Command
$count = 0;
foreach ($this->rows('links') as $row) {
DB::table('links')->updateOrInsert(['id' => (int) $row['linkid']], [
'name' => $row['name'],
'name' => html_entity_decode((string) $row['name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'url' => $row['url'],
'note' => $row['note'] ?: null,
'display_order' => (int) $row['displayorder'],