blog.git

blog

~ Personal research notes. blog.sqzer.com
git clone https://github.com/debuman/blog.git
commit effa6f1ff24968ff0afee7ef30d4196e59951f52
parent 540215720a4ae0693a1b20a3af9f6ad9c2c631e5
Author: sqzer <110329244+sqzer-x@users.noreply.github.com>
Date: Fri, 25 Sep 2026 03:26:22 +0900

fix: stop Satteri reading the body's first line as front matter

Astro splits the front matter off before rendering and hands Satteri the
trimmed body, but Satteri parses front matter by default. A post whose
body opened with a --- rule lost everything up to the next ---, ... or
+++ line, with no log, and the page still had a body so the render guard
could not see it.

Nothing reads what Satteri would parse there: Astro's metadata
frontmatter is the loader's own copy. The existing 30 posts build
byte-identical. The comment above the features block no longer claims
every unlisted feature defaults off.

Diffstat:
Mastro.config.mjs | 18+++++++++++++++---
1 file changed, 15 insertion(+), 3 deletion(-)

diff --git a/astro.config.mjs b/astro.config.mjs
@@ -112,11 +112,23 @@ export default defineConfig({
       mdastPlugins: [satteriKorean(), satteriFigure()],
       hastPlugins: [satteriProse({ publicDir: 'public' }), satteriDiagram()],
       /*
-       * Parser flags. Astro hands Sätteri only `{ gfm, smartPunctuation }` and every other
-       * entry in `Features` defaults off, so what is listed here is the whole of the
-       * difference from stock — and each line is a defect that was measurable in dist/.
+       * Parser flags. Astro hands Sätteri only `{ gfm, smartPunctuation }`. Every other
+       * entry in `Features` defaults off except `frontmatter`, which Sätteri turns on unless
+       * told otherwise (`features.frontmatter ?? true` in satteri/dist/compile.js). What is
+       * listed here is the whole of the difference from stock, and each line is a defect
+       * that was measurable in dist/.
        */
       features: {
+        /*
+         * Astro has already split the front matter off: the loader hands over the body,
+         * trimmed (astro/dist/vite-plugin-markdown/content-entry-type.js). Left on, Sätteri
+         * reads that body's first line as a second front-matter fence, so a post opening
+         * with a `---` rule loses everything up to the next `---`, `...` or `+++` pair. It
+         * drops without a log, and the page still has a body for the render guard to find.
+         * Nothing reads what Sätteri would parse there: Astro's metadata.frontmatter is the
+         * loader's own copy.
+         */
+        frontmatter: false,
         /*
          * Smart punctuation, minus the dash rule. Quotes and ellipses are worth having in
          * 70-odd lines of prose; the dash rule is not, because it does not know what a CLI