Skip to content

Commit 7295b01

Browse files
authored
Merge pull request #23 from galaxyproject/site
Toolchain floor: bring the pattern site onto the reference stack
2 parents eb7c159 + 551140f commit 7295b01

8 files changed

Lines changed: 1591 additions & 2107 deletions

File tree

content/pattern/standing-up-a-foundry.instructions.txt

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,35 @@ that a note is well-formed.
266266
legibility is a substrate concern.
267267
- ASTRO 7 RUNS NO REMARK OR REHYPE PLUGIN UNLESS YOU ASK. It renders markdown with Sätteri, a Rust
268268
pipeline, and `markdown.remarkPlugins` — the astro ≤6 spelling, and the one every tutorial still
269-
shows — is simply not consulted. It does not warn. The failure is a site that builds clean with
270-
every `[[Target]]` rendered as literal text and every `$…$` as literal dollars, which is why the
271-
wiring above names `markdown.processor` instead: opting the unified pipeline back in explicitly.
272-
For this stack that is not a nicety — `[[wiki-links]]` is one of the six installed packages, and
273-
Part 4's link check asserts against a grammar the renderer would no longer be applying.
274-
`compressHTML: true` is a second pin of the same shape: 7 defaults it to 'jsx', which drops the
275-
whitespace between inline elements that sit on their own source lines, so prose silently loses
276-
spaces around links. Both are places where the SILENT default changed, and both are worth a
277-
comment in the config saying so — a future reader deleting either sees no test go red.
269+
shows — is not the wiring any more, which is why the block above names `markdown.processor`
270+
instead: opting the unified pipeline back in explicitly. For this stack that is not a nicety —
271+
`[[wiki-links]]` is one of the six installed packages, and Part 4's link check asserts against a
272+
grammar the renderer would no longer be applying.
273+
This entry USED to say the legacy spelling was silently ignored, leaving a site that built clean
274+
with every `[[Target]]` rendered as literal text. Measured against 7.1.6 while bringing the
275+
pattern repo itself onto the stack, that is wrong, and wrong in the reassuring direction: there
276+
is a shim. With `@astrojs/markdown-remark` absent the build FAILS and names the package to
277+
install. With it present, and `markdown.processor` either unset or already a unified one, the
278+
plugins are moved onto it and you get a deprecation warning. Either way you are told. Write
279+
`markdown.processor` because it is the form the shim is asking for, not out of fear of a silent
280+
break. The one arrangement that still loses plugins quietly is setting `processor: satteri(…)`
281+
and leaving `remarkPlugins` beside it: the shim will not migrate onto a non-unified processor,
282+
so you get a warning and no plugins. Do not spell both.
283+
- `compressHTML: true` is the pin in this part that DOES fail silently, and it is the one to spend
284+
the paranoia on. 7 defaults it to 'jsx', which drops the whitespace between inline elements that
285+
sit on their own source lines. Removing the pin on a finished site builds clean and glues prose
286+
together on every page — nav rendering as `The PatternThe CaseInstances`, and the spaces around
287+
inline links gone. Nothing goes red. Worth a comment in the config saying so, because a future
288+
reader deleting it gets no other signal.
289+
Both pins share a lesson bigger than either: ACCEPT A BUMP ON THE RENDERED PAGE, NOT THE BUILD.
290+
A green `astro build` is evidence about the build, and these are defaults that change the OUTPUT.
291+
Keep the pre-bump dist/, then diff the rendered TEXT of every page against it: strip the tags,
292+
collapse runs of whitespace, compare. A glued word merges two tokens into one, so it shows up as
293+
a changed line. Count the resolved `[[link]]` anchors on both sides too — equal counts is the
294+
check the processor migration actually needs.
295+
Strip each tag to the EMPTY STRING, not to a space. Replacing `</a>` with a space re-supplies
296+
the very whitespace compressHTML dropped, and the comparison passes clean on a site whose every
297+
page has visibly run together — which is this bullet's own failure mode, found by running it.
278298
- Declare routes in the page router site/src/pages/<collection>/[...slug].astro (+ index.astro
279299
per collection), and name each route AFTER ITS COLLECTION KEY, so the key IS the route and
280300
there is no mapping to keep. The collection table (Part 3) is then the only list of

site/astro.config.mjs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import { unified } from '@astrojs/markdown-remark';
34
import tailwindcss from '@tailwindcss/vite';
45
import pagefind from 'astro-pagefind';
56
import remarkWikiLinks from './src/lib/remark-wiki-links.ts';
@@ -12,13 +13,22 @@ const BASE = '/foundry-pattern';
1213
export default defineConfig({
1314
site: SITE,
1415
base: BASE,
16+
// Astro 7 defaults this to 'jsx', which drops the whitespace between inline elements that
17+
// sit on their own source lines — prose loses the spaces around its links. Pinned to the
18+
// pre-7 behaviour rather than hand-spacing the components.
19+
compressHTML: true,
1520
integrations: [pagefind()],
21+
// Astro 7 renders markdown with Sätteri, which runs no remark plugins. `[[wiki-links]]` are
22+
// this corpus's link grammar and the prebuild link check asserts against them, so the unified
23+
// pipeline is opted back into explicitly. The astro ≤6 spelling — `markdown.remarkPlugins` —
24+
// still works in 7.1.6 via a shim that migrates the array onto a unified processor and warns;
25+
// this is the non-deprecated form the shim is telling you to write.
1626
markdown: {
17-
remarkPlugins: [[remarkWikiLinks, { contentDir: '../content', base: BASE }]],
27+
processor: unified({
28+
remarkPlugins: [[remarkWikiLinks, { contentDir: '../content', base: BASE }]],
29+
}),
1830
},
1931
vite: {
20-
// Cast: Astro bundles its own nested vite, so the plugin's vite types and the
21-
// top-level vite types are nominally distinct though structurally identical.
22-
plugins: [/** @type {any} */ (tailwindcss())],
32+
plugins: [tailwindcss()],
2333
},
2434
});

0 commit comments

Comments
 (0)