fix(news): correct field names pubDate→published, description→summary, stats paths, add x-cloak
Build & Deploy / build-and-deploy (push) Successful in 2m6s

This commit is contained in:
svemagie
2026-04-19 12:01:21 +02:00
parent 33c976b3cf
commit b9617078b1
+9 -9
View File
@@ -103,11 +103,11 @@ withSidebar: true
<div class="flex flex-wrap gap-4 mb-6 p-4 bg-surface-50 dark:bg-surface-800/50 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm text-sm">
<div class="flex items-center gap-2">
<span class="text-surface-600 dark:text-surface-400">Feeds:</span>
<span class="font-medium font-mono text-surface-900 dark:text-surface-100" x-text="status?.stats?.feedsCount || feeds.length"></span>
<span class="font-medium font-mono text-surface-900 dark:text-surface-100" x-text="status?.blogs?.count || feeds.length"></span>
</div>
<div class="flex items-center gap-2">
<span class="text-surface-600 dark:text-surface-400">Items:</span>
<span class="font-medium font-mono text-surface-900 dark:text-surface-100" x-text="status?.stats?.itemsCount || items.length"></span>
<span class="font-medium font-mono text-surface-900 dark:text-surface-100" x-text="status?.items?.count || items.length"></span>
</div>
<div x-show="status?.status === 'syncing'" class="flex items-center gap-2 text-orange-600 dark:text-orange-400">
<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24">
@@ -148,7 +148,7 @@ withSidebar: true
x-text="item.title"
></a>
</h2>
<p x-show="item.description" class="text-sm text-surface-600 dark:text-surface-400 line-clamp-2 mb-2" x-text="item.description"></p>
<p x-show="item.summary" class="text-sm text-surface-600 dark:text-surface-400 line-clamp-2 mb-2" x-text="item.summary"></p>
<div class="flex flex-wrap items-center gap-2 text-xs text-surface-600 dark:text-surface-400">
<a
:href="item.sourceUrl || item.blog?.siteUrl || getFeedUrl(item.feedId) || item.link"
@@ -159,7 +159,7 @@ withSidebar: true
x-text="truncate(item.sourceTitle || item.feedTitle || item.blog?.title, 25)"
></a>
<span x-show="item.author || item.blog?.title" x-text="'by ' + (item.author || item.blog?.title)"></span>
<time class="font-mono text-sm" :datetime="item.pubDate" x-text="formatDate(item.pubDate)"></time>
<time class="font-mono text-sm" :datetime="item.published" x-text="formatDate(item.published)"></time>
<span class="hidden sm:inline" x-show="item.categories?.length">
<template x-for="cat in item.categories.slice(0, 3)" :key="cat">
<span class="text-accent-600 dark:text-accent-400" x-text="'#' + cat"></span>
@@ -214,10 +214,10 @@ withSidebar: true
x-text="item.title"
></a>
</h2>
<p x-show="item.description" class="text-sm text-surface-600 dark:text-surface-400 line-clamp-3 mb-3" x-text="item.description"></p>
<p x-show="item.summary" class="text-sm text-surface-600 dark:text-surface-400 line-clamp-3 mb-3" x-text="item.summary"></p>
<div class="flex items-center justify-between text-xs text-surface-600 dark:text-surface-400">
<span class="truncate max-w-[60%]" x-text="truncate(item.sourceTitle || item.feedTitle || item.blog?.title, 20)"></span>
<time class="font-mono text-sm" :datetime="item.pubDate" x-text="formatDate(item.pubDate)"></time>
<time class="font-mono text-sm" :datetime="item.published" x-text="formatDate(item.published)"></time>
</div>
<button
class="share-post-btn mt-2"
@@ -269,7 +269,7 @@ withSidebar: true
<span class="font-medium text-surface-700 dark:text-surface-300" x-text="item.sourceTitle || item.feedTitle || item.blog?.title"></span>
</a>
<span x-show="item.author || item.blog?.title" class="text-surface-600 dark:text-surface-400" x-text="'by ' + (item.author || item.blog?.title)"></span>
<time :datetime="item.pubDate" class="font-mono text-sm text-surface-600 dark:text-surface-400" x-text="formatDate(item.pubDate, 'long')"></time>
<time :datetime="item.published" class="font-mono text-sm text-surface-600 dark:text-surface-400" x-text="formatDate(item.published, 'long')"></time>
</div>
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4">
@@ -282,7 +282,7 @@ withSidebar: true
></a>
</h2>
<p x-show="item.description" class="text-surface-600 dark:text-surface-400 mb-4 leading-relaxed" x-text="item.description"></p>
<p x-show="item.summary" class="text-surface-600 dark:text-surface-400 mb-4 leading-relaxed" x-text="item.summary"></p>
<div class="flex flex-wrap items-center gap-3">
<a
@@ -353,7 +353,7 @@ withSidebar: true
</template>
{# Empty State #}
<div x-show="!loading && items.length === 0 && !error" class="text-center py-12">
<div x-show="!loading && items.length === 0 && !error" x-cloak class="text-center py-12">
<svg class="w-16 h-16 mx-auto text-surface-300 dark:text-surface-400 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"/>
</svg>