fix(web-app): use BASE_URL for skills.json and SKILL.md fetch on GitHub Pages

This commit is contained in:
sck_0
2026-03-07 12:37:56 +01:00
parent 17abf5abb4
commit 17e7618fd8
2 changed files with 4 additions and 2 deletions

View File

@@ -20,7 +20,8 @@ export function SkillProvider({ children }: { children: React.ReactNode }) {
if (!silent) setLoading(true);
try {
// Fetch skills index
const res = await fetch('/skills.json');
const base = import.meta.env.BASE_URL;
const res = await fetch(`${base}skills.json`);
const data = await res.json();
// Incremental loading: set first 50 skills immediately if not a silent refresh

View File

@@ -75,7 +75,8 @@ export function SkillDetail(): React.ReactElement {
? skill.path.replace('skills/', '')
: skill.path;
const mdRes = await fetch(`/skills/${cleanPath}/SKILL.md`);
const base = import.meta.env.BASE_URL;
const mdRes = await fetch(`${base}skills/${cleanPath}/SKILL.md`);
if (!mdRes.ok) throw new Error('Skill file not found');
const text = await mdRes.text();