Skip to content

Commit d661b4b

Browse files
afuchereca-agent
andcommitted
fix(website): replace all hardcoded root-relative paths with BASE_URL / relative links
All paths were broken under base: '/AstroChart' because they resolved to the domain root instead of /AstroChart/... Scalable approach: the only place that ever needs to change is `base` in astro.config.mjs. All other files derive from it. website/src/utils/url.ts — new helper Exports `withBase(path)` which strips the trailing slash from import.meta.env.BASE_URL and prepends it to the given path. Single source of truth for all .astro runtime links. website/src/pages/index.astro Import and use `withBase()` for all 4 hardcoded root-relative paths: - hero action link: '/installation' - version badge: href="/changelog" - CTA footer: href="/installation", href="/quickstart" website/src/content/docs/** (21 files) Convert every absolute /docs/..., /api/..., /guides/... link to a relative path (e.g. ./quickstart, ../api/chart, ./frameworks/react). Relative links are resolved by Starlight against the current page URL and are therefore base-agnostic — no code or imports needed. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <git@eca.dev>
1 parent c8a4cc6 commit d661b4b

23 files changed

Lines changed: 83 additions & 71 deletions

website/src/content/docs/api/aspect-calculator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ console.log(angle) // Aspect angle in degrees
3030

3131
## Next Steps
3232

33-
- **[Radix Chart Guide](/docs/guides/radix-chart)** — See aspects in action
34-
- **[API Reference](/docs/api/chart)** — See all methods
33+
- **[Radix Chart Guide](../guides/radix-chart)** — See aspects in action
34+
- **[API Reference](./chart)** — See all methods

website/src/content/docs/api/chart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ chart.animate(newTransitData, 1000, false, () => {
6666

6767
## Next Steps
6868

69-
- **[Radix Guide](/docs/guides/radix-chart)** — Learn about radix charts
70-
- **[Transit Guide](/docs/guides/transit-chart)** — Learn about transit charts
71-
- **[Settings Reference](/docs/api/settings)** — Customize chart appearance
69+
- **[Radix Guide](../guides/radix-chart)** — Learn about radix charts
70+
- **[Transit Guide](../guides/transit-chart)** — Learn about transit charts
71+
- **[Settings Reference](./settings)** — Customize chart appearance

website/src/content/docs/api/radix.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const transit = radix.transit(transitData)
5959
transit.aspects()
6060
```
6161

62-
See the [Transit API](/api/transit) for full details.
62+
See the [Transit API](./transit) for full details.
6363

6464
### `radix.addPointsOfInterest(points: Points): Radix`
6565

@@ -77,13 +77,13 @@ radix.aspects()
7777

7878
| Field | Type | Constraint |
7979
|-------|------|------------|
80-
| `planets` | `Record<string, number[]>` | Keys must be [valid planet names](/api/types#valid-planet-keys) |
80+
| `planets` | `Record<string, number[]>` | Keys must be [valid planet names](./types#valid-planet-keys) |
8181
| `cusps` | `number[]` | Exactly **12** degree values |
8282

8383
Planet array: `[degrees, velocity]` — the second element is the astrological velocity; a negative value means the planet is retrograde.
8484

8585
## Next Steps
8686

87-
- [Types reference](/api/types)`AstroData`, valid planet keys, full example
88-
- [Transit API](/api/transit) — transit ring methods
89-
- [Radix Chart guide](/guides/radix-chart) — practical walkthrough
87+
- [Types reference](./types)`AstroData`, valid planet keys, full example
88+
- [Transit API](./transit) — transit ring methods
89+
- [Radix Chart guide](../guides/radix-chart) — practical walkthrough

website/src/content/docs/api/settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ chart.radix(data)
4444

4545
## Next Steps
4646

47-
- **[Custom Settings Guide](/docs/guides/custom-settings)** — Learn more
48-
- **[Types Reference](/docs/api/types)** — See all type definitions
47+
- **[Custom Settings Guide](../guides/custom-settings)** — Learn more
48+
- **[Types Reference](./types)** — See all type definitions

website/src/content/docs/api/transit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ transit.animate(newTransitData, 1500)
4040

4141
## Next Steps
4242

43-
- **[Transit Chart Guide](/docs/guides/transit-chart)** — Learn more
44-
- **[Animation Guide](/docs/guides/animation)** — Learn about animations
43+
- **[Transit Chart Guide](../guides/transit-chart)** — Learn more
44+
- **[Animation Guide](../guides/animation)** — Learn about animations

website/src/content/docs/api/types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const data = {
9292
## Settings
9393

9494
Partial settings object passed as an optional fourth argument to `new Chart()`.
95-
See the [Settings reference](/api/settings) for all available keys.
95+
See the [Settings reference](./settings) for all available keys.
9696

9797
```typescript
9898
interface Settings {
@@ -107,6 +107,6 @@ interface Settings {
107107

108108
## Next Steps
109109

110-
- [Settings Reference](/api/settings) — all configurable settings
111-
- [Chart API](/api/chart)`Chart` class methods
112-
- [Radix Chart guide](/guides/radix-chart) — practical walkthrough
110+
- [Settings Reference](./settings) — all configurable settings
111+
- [Chart API](./chart)`Chart` class methods
112+
- [Radix Chart guide](../guides/radix-chart) — practical walkthrough

website/src/content/docs/api/zodiac.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ const degrees = getZodiacDegrees('Aries') // 0
3838

3939
## Next Steps
4040

41-
- **[Guides](/docs/guides/radix-chart)** — See zodiac in action
42-
- **[API Reference](/docs/api/chart)** — See all methods
41+
- **[Guides](../guides/radix-chart)** — See zodiac in action
42+
- **[API Reference](./chart)** — See all methods

website/src/content/docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Feature requests are welcome! Please describe:
5959
## Questions?
6060

6161
- Open an issue on [GitHub](https://github.com/AstroDraw/AstroChart/issues)
62-
- Check the [Documentation](/docs/introduction)
62+
- Check the [Documentation](./introduction)
6363
- Review existing issues for similar questions
6464

6565
## License

website/src/content/docs/guides/animation.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,6 @@ loop()
266266

267267
## Next Steps
268268

269-
- **[Transit Charts](/docs/guides/transit-chart)** — Learn about transit rendering
270-
- **[Custom Settings](/docs/guides/custom-settings)** — Customize animation appearance
271-
- **[API Reference](/docs/api/transit)** — Full Transit API documentation
269+
- **[Transit Charts](./transit-chart)** — Learn about transit rendering
270+
- **[Custom Settings](./custom-settings)** — Customize animation appearance
271+
- **[API Reference](../api/transit)** — Full Transit API documentation

website/src/content/docs/guides/click-events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ Use these helper functions to identify clicked elements:
3434

3535
## Next Steps
3636

37-
- **[Framework Integrations](/docs/guides/frameworks/react)** — Use with React, Vue, etc.
38-
- **[API Reference](/docs/api/chart)** — See all methods
37+
- **[Framework Integrations](./frameworks/react)** — Use with React, Vue, etc.
38+
- **[API Reference](../api/chart)** — See all methods

0 commit comments

Comments
 (0)