From 4241ac486b1575f5ce7d614fbd42c4738fa9bd36 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 12:51:58 +0000 Subject: [PATCH] Refactor sponsor tier links into tier data Store only the Open Collective tier slug and GitHub Sponsors tier id on each tier and derive the checkout URLs from them, so amounts are no longer duplicated in the links. Removes tierLinks.ts and the circular import between it and tiers.ts. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G9u8FefqMHXb8HoeQ8LhcU --- .../sponsor/SponsorAmountPicker.vue | 2 +- .../components/sponsor/SponsorTierCard.vue | 2 +- .../theme/components/sponsor/tierLinks.ts | 33 ---------- .../theme/components/sponsor/tiers.ts | 63 +++++++++++++------ 4 files changed, 46 insertions(+), 54 deletions(-) delete mode 100644 docs/.vitepress/theme/components/sponsor/tierLinks.ts diff --git a/docs/.vitepress/theme/components/sponsor/SponsorAmountPicker.vue b/docs/.vitepress/theme/components/sponsor/SponsorAmountPicker.vue index 0e297042b..85d8c48b1 100644 --- a/docs/.vitepress/theme/components/sponsor/SponsorAmountPicker.vue +++ b/docs/.vitepress/theme/components/sponsor/SponsorAmountPicker.vue @@ -40,7 +40,7 @@ const tier = computed(() => (isMonthly.value ? getTierForAmount(total.value) : n const links = computed(() => { const value = Math.round(total.value); - if (customAmount.value === '' && tier.value) return getTierLinks(tier.value.id); + if (customAmount.value === '' && tier.value) return getTierLinks(tier.value); if (value > 0) return getAmountLinks(value, frequency.value); return getTierLinks(); diff --git a/docs/.vitepress/theme/components/sponsor/SponsorTierCard.vue b/docs/.vitepress/theme/components/sponsor/SponsorTierCard.vue index d4df714e3..d4e9db33b 100644 --- a/docs/.vitepress/theme/components/sponsor/SponsorTierCard.vue +++ b/docs/.vitepress/theme/components/sponsor/SponsorTierCard.vue @@ -10,7 +10,7 @@ const props = defineProps<{ }>(); const previousTier = computed(() => getPreviousTier(props.tier.id)); -const links = computed(() => getTierLinks(props.tier.id)); +const links = computed(() => getTierLinks(props.tier));