fix(web-app): use BASE_URL for skills.json and SKILL.md fetch on GitHub Pages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user