diff --git a/src/components/StatsChart.astro b/src/components/StatsChart.astro
index 23b544e..08ef5ec 100644
--- a/src/components/StatsChart.astro
+++ b/src/components/StatsChart.astro
@@ -10,9 +10,11 @@ interface Props {
subtitle?: string;
type: 'pie' | 'line';
items: ChartItem[];
+ totalLabel?: string;
+ valueLabel?: string;
}
-const { title, subtitle, type, items } = Astro.props;
+const { title, subtitle, type, items, totalLabel = '篇文章', valueLabel = '篇' } = Astro.props;
const colors = ['#3eb8be', '#f2a65a', '#7f9cf5', '#68b684', '#f07f7f', '#b18ce8', '#e0b34f', '#5ca4d3'];
const safeItems = items.filter((item) => item.value > 0);
const total = safeItems.reduce((sum, item) => sum + item.value, 0);
@@ -74,7 +76,7 @@ const labelStep = Math.max(1, Math.ceil(linePoints.length / 6));
>
))}
{total}
- 篇文章
+ {totalLabel}
@@ -124,7 +126,7 @@ const labelStep = Math.max(1, Math.ceil(linePoints.length / 6));
{linePoints.map((point, index) => (
<>
-
{`${point.label}: ${point.value} 篇`}
+
{`${point.label}: ${point.value} ${valueLabel}`}
{index % labelStep === 0 && (
{point.label}
diff --git a/src/pages/categories/index.astro b/src/pages/categories/index.astro
index 27513a2..7221664 100644
--- a/src/pages/categories/index.astro
+++ b/src/pages/categories/index.astro
@@ -11,12 +11,30 @@ const categoryStats = categories.map((category) => ({
value: posts.filter((post) => post.categories.includes(category)).length,
href: getCategoryHref(category),
}));
+const uncategorizedCount = posts.filter((post) => post.categories.length === 0).length;
+const multiCategoryCount = posts.filter((post) => post.categories.length > 1).length;
+const categoryArchiveCount = categoryStats.reduce((sum, category) => sum + category.value, 0) + uncategorizedCount;
+const categoryChartStats = [
+ ...categoryStats,
+ {
+ label: '未分类',
+ value: uncategorizedCount,
+ },
+];
+const categoryChartSubtitle = [
+ `${posts.length} 篇文章`,
+ `${categoryArchiveCount} 次归档`,
+ multiCategoryCount ? `${multiCategoryCount} 篇多分类` : null,
+ uncategorizedCount ? `${uncategorizedCount} 篇未分类` : null,
+]
+ .filter(Boolean)
+ .join(' · ');
---
-
+
{categoryStats.map((category) => (
diff --git a/src/styles/site.css b/src/styles/site.css
index 52d26e2..4e9c341 100644
--- a/src/styles/site.css
+++ b/src/styles/site.css
@@ -646,6 +646,7 @@ a {
.post-layout .article {
width: 100%;
+ min-width: 0;
margin: 0;
}
@@ -1314,6 +1315,7 @@ time {
.article {
--article-padding: clamp(24px, 5vw, 48px);
width: min(var(--article-width), calc(100% - (var(--page-gutter) * 2)));
+ min-width: 0;
margin: 64px auto 84px;
border: 1px solid rgba(255, 255, 255, 0.58);
border-radius: 8px;
@@ -1329,6 +1331,10 @@ time {
-webkit-backdrop-filter: blur(18px) saturate(165%);
}
+.prose {
+ min-width: 0;
+}
+
.article-header {
position: relative;
margin-bottom: 28px;
@@ -1665,6 +1671,7 @@ time {
}
.prose pre {
+ max-width: 100%;
margin: 0;
overflow-x: auto;
padding: 18px;
@@ -1931,6 +1938,9 @@ time {
.prose .code-block {
position: relative;
+ width: 100%;
+ max-width: 100%;
+ min-width: 0;
margin: 1.25em 0;
overflow: hidden;
border: 1px solid rgba(15, 118, 110, 0.16);
@@ -1967,6 +1977,7 @@ time {
}
.prose .code-block pre {
+ max-width: 100%;
max-height: none;
padding: 44px 18px 18px;
background: transparent;