Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
.rubocop-*
CLAUDE.md

# Local planning artifacts — never commit
TODO*
**/TODO*

8 changes: 5 additions & 3 deletions docs/.vitepress/theme/FormulaBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -266,7 +268,7 @@ function toggleSource(value) {
<div v-for="letter in activeLetters" :key="letter" :id="'letter-' + letter" class="letter-group">
<h3 class="letter-heading">{{ letter }}</h3>
<div class="formula-items">
<a v-for="f in groupedFormulas[letter]" :key="f.slug" :href="f.slug + '/'" class="formula-item" @click.stop.prevent="goToFormula(f.slug)">
<a v-for="f in groupedFormulas[letter]" :key="f.slug" :href="`${basePath}browse/${f.slug}`" class="formula-item" @click.stop.prevent="goToFormula(f.slug)">
<div class="formula-main">
<span class="formula-name">{{ f.name }}</span>
<span class="formula-key">{{ f.formulaName }}</span>
Expand Down
8 changes: 5 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -164,7 +166,7 @@ watch(searchQuery, (val) => {
<a
v-for="(item, idx) in autocompleteResults"
:key="item.slug"
:href="basePath + 'browse/' + item.slug + '/'"
:href="basePath + 'browse/' + item.slug"
:class="getItemClass(idx)"
@mouseover="selectedIndex = idx"
@click.stop.prevent="goToFormula(item.slug)"
Expand Down
Loading