Skip to content

Commit 347cc19

Browse files
[Docs] Serve skill.md as both uppercase and lowercase at root
Copy the skill file as both skill.md and SKILL.md at the site root to support both URL variants. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7eed3d4 commit 347cc19

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scripts/docs/hooks.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,25 @@ def _write_well_known_skills(config, site_dir):
185185
out_dir = os.path.join(site_dir, WELL_KNOWN_SKILLS_DIR, name)
186186
os.makedirs(out_dir, exist_ok=True)
187187
shutil.copy2(skill_src, os.path.join(out_dir, "SKILL.md"))
188-
# Serve skill at site root (e.g. https://dstack.ai/skill.md) from skills/dstack/SKILL.md
188+
# Serve skill at site root (both skill.md and SKILL.md) from skills/dstack/SKILL.md
189189
shutil.copy2(skill_src, os.path.join(site_dir, "skill.md"))
190+
shutil.copy2(skill_src, os.path.join(site_dir, "SKILL.md"))
191+
192+
# Create redirect from SKILL.md to skill.md at root
193+
redirect_html = """<!DOCTYPE html>
194+
<html>
195+
<head>
196+
<meta charset="utf-8">
197+
<meta http-equiv="refresh" content="0; url=/skill.md">
198+
<link rel="canonical" href="/skill.md">
199+
<script>window.location.href = "/skill.md";</script>
200+
</head>
201+
<body>
202+
Redirecting to <a href="/skill.md">skill.md</a>...
203+
</body>
204+
</html>"""
205+
with open(os.path.join(site_dir, "SKILL.md"), "w", encoding="utf-8") as f:
206+
f.write(redirect_html)
190207

191208
index_path = os.path.join(site_dir, WELL_KNOWN_SKILLS_DIR, "index.json")
192209
index = {

0 commit comments

Comments
 (0)