From cf70a6fc3e8cca0665ecb4bbd2cb4b046b84b0fd Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Wed, 29 Jul 2026 14:15:16 +0200 Subject: [PATCH] Render ```small code fences at a reduced font size --- astro.config.mjs | 7 ++++++- src/layouts/PostLayout.astro | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index f7982f6..e1b528a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -17,6 +17,11 @@ export default defineConfig({ }, markdown: { rehypePlugins: [rehypeSlug], - shikiConfig: { theme: 'github-light' }, + shikiConfig: { + theme: 'github-light', + // ```small — plain text, rendered at a smaller size (see PostLayout's + // `pre[data-language="small"]` rule). Useful for wide terminal traces. + langAlias: { small: 'text' }, + }, }, }); diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index a89f586..35e9068 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -94,6 +94,10 @@ if (!isHtml) { padding: 12px; overflow-x: auto; } + /* ```small — plain-text blocks set a size down, so wide terminal traces + fit the column without wrapping or horizontal scrolling. */ + .prose-body pre[data-language="small"] { font-size: 0.7em; line-height: 1.5; } + .prose-body pre[data-language="small"] code { font-size: 1em; } /* Inside a block, the
 already carries the chip treatment. */
     .prose-body pre code {
       color: inherit;
-- 
2.51.2