diff --git a/.gitignore b/.gitignore index 0ec8d86c..ad1059e1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ .rubocop-* CLAUDE.md +# Local planning artifacts — never commit +TODO* +**/TODO* + diff --git a/docs/.vitepress/theme/FormulaBrowser.vue b/docs/.vitepress/theme/FormulaBrowser.vue index df686037..6582edd9 100644 --- a/docs/.vitepress/theme/FormulaBrowser.vue +++ b/docs/.vitepress/theme/FormulaBrowser.vue @@ -7,6 +7,7 @@ const formulasData = ref([]) const searchQuery = ref('') const selectedLicenses = ref(['all']) const selectedSources = ref(['all']) +const basePath = import.meta.env.BASE_URL || '/' const licenseOptions = [ { value: 'all', label: 'All Licenses', icon: 'all', count: 0 }, @@ -211,8 +212,9 @@ function goToFormula(slug) { // "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}/` + // No trailing slash: cleanUrls:true route map expects /browse/foo, and + // GitHub Pages serves /browse/foo/index.html for either form. + window.location.href = `${basePath}browse/${slug}` } function toggleLicense(value) { @@ -266,7 +268,7 @@ function toggleSource(value) {

{{ letter }}

- +
{{ f.name }} {{ f.formulaName }} diff --git a/docs/index.md b/docs/index.md index c4351f51..d1f4330b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -87,7 +87,9 @@ function goToFormula(slug) { // 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}/` + // No trailing slash: cleanUrls:true route map expects /browse/foo, and + // GitHub Pages serves /browse/foo/index.html for either form. + window.location.href = `${basePath}browse/${slug}` } function getSourceBadge(f) { @@ -125,7 +127,7 @@ function onKeydown(e) { } else if (e.key === 'Enter') { e.preventDefault() if (selectedIndex.value >= 0) { - window.location.href = `${basePath}browse/${results[selectedIndex.value].slug}/` + window.location.href = `${basePath}browse/${results[selectedIndex.value].slug}` } else { handleSearch(e) } @@ -164,7 +166,7 @@ watch(searchQuery, (val) => {