From ea3d8accc33a79cf4a82fc8f78354524a7c7356d Mon Sep 17 00:00:00 2001 From: grassblock Date: Fri, 23 May 2025 22:35:14 +0800 Subject: [PATCH] feat: better style when printing the article --- src/pages/post/[...slug].astro | 2 +- src/styles/global.css | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/post/[...slug].astro b/src/pages/post/[...slug].astro index e7f5f56..5637409 100644 --- a/src/pages/post/[...slug].astro +++ b/src/pages/post/[...slug].astro @@ -52,7 +52,7 @@ const cover = customFeaturedImage || matchedImage_src?.src || `/post/${slug}/fea -
+

← Back to posts diff --git a/src/styles/global.css b/src/styles/global.css index d7aca76..295c9ba 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -290,4 +290,12 @@ div.content { .content-box { padding: 1rem; } +} + +/* Printing */ +@media print { + /* Hide elements not needed for print */ + nav.nav,.search-container,footer,div.extra-post { + display: none; + } } \ No newline at end of file