diff --git a/docs/.vitepress/theme/FormulaBrowser.vue b/docs/.vitepress/theme/FormulaBrowser.vue index f6fb38a8..df686037 100644 --- a/docs/.vitepress/theme/FormulaBrowser.vue +++ b/docs/.vitepress/theme/FormulaBrowser.vue @@ -204,6 +204,17 @@ function scrollToLetter(letter) { if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }) } +function goToFormula(slug) { + // Formula pages are rendered in CI batches (docs.yml build-batch matrix), + // and each batch's VitePress router manifest only includes its own pages. + // SPA navigation from /browse/ to a formula in a different batch hits a + // "Page not found" 404 even though the SSR HTML exists on the server. + // Bypass SPA routing for formula clicks — full page load fetches the + // correct HTML which loads the correct app chunk for that formula's batch. + const basePath = import.meta.env.BASE_URL || '/' + window.location.href = `${basePath}browse/${slug}/` +} + function toggleLicense(value) { if (value === 'all') { selectedLicenses.value = ['all'] @@ -255,7 +266,7 @@ function toggleSource(value) {

{{ letter }}

- +
{{ f.name }} {{ f.formulaName }} diff --git a/docs/index.md b/docs/index.md index e99d011c..c4351f51 100644 --- a/docs/index.md +++ b/docs/index.md @@ -82,6 +82,14 @@ function getLicenseBadge(f) { return `Unknown` } +function goToFormula(slug) { + // Formula pages are rendered in CI batches, and each batch's VitePress + // router manifest only knows about its own pages. SPA navigation from + // the homepage to a formula in a different batch 404s. Force a full page + // load so the server sends the correct HTML with the correct app chunk. + window.location.href = `${basePath}browse/${slug}/` +} + function getSourceBadge(f) { if (!f) return `Expert Curated` if (f.sourceType === 'google') return `Google Fonts` @@ -159,6 +167,7 @@ watch(searchQuery, (val) => { :href="basePath + 'browse/' + item.slug + '/'" :class="getItemClass(idx)" @mouseover="selectedIndex = idx" + @click.stop.prevent="goToFormula(item.slug)" >
{{ item.name }}