Skip to content

Commit b89dfa0

Browse files
[Docs] Move SKILL.md to skills/dstack
1 parent a34679d commit b89dfa0

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

scripts/docs/hooks.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
log = logging.getLogger("mkdocs")
1212

1313
WELL_KNOWN_SKILLS_DIR = ".well-known/skills"
14-
SKILL_SOURCE = "skill.md"
14+
SKILL_PATH = ("skills", "dstack", "SKILL.md")
1515
DISABLE_EXAMPLES_ENV = "DSTACK_DOCS_DISABLE_EXAMPLES"
1616

1717

@@ -79,12 +79,13 @@ def on_post_build(config):
7979
os.makedirs(os.path.dirname(dest_path), exist_ok=True)
8080
shutil.copy2(src_path, dest_path)
8181

82-
_write_well_known_skills(docs_dir, site_dir)
82+
_write_well_known_skills(config, site_dir)
8383

8484

85-
def _write_well_known_skills(docs_dir, site_dir):
86-
"""Parse skill.md and write .well-known/skills/index.json. name and description come from frontmatter only."""
87-
skill_src = os.path.join(docs_dir, SKILL_SOURCE)
85+
def _write_well_known_skills(config, site_dir):
86+
"""Parse skills/dstack/SKILL.md and write .well-known/skills/index.json. name and description come from frontmatter only."""
87+
repo_root = os.path.dirname(config["config_file_path"])
88+
skill_src = os.path.join(repo_root, *SKILL_PATH)
8889
if not os.path.isfile(skill_src):
8990
return
9091

@@ -105,13 +106,15 @@ def _write_well_known_skills(docs_dir, site_dir):
105106

106107
if not name or not description:
107108
log.warning(
108-
"skill.md missing name or description in frontmatter; skipping .well-known/skills"
109+
"skills/dstack/SKILL.md missing name or description in frontmatter; skipping .well-known/skills"
109110
)
110111
return
111112

112113
out_dir = os.path.join(site_dir, WELL_KNOWN_SKILLS_DIR, name)
113114
os.makedirs(out_dir, exist_ok=True)
114115
shutil.copy2(skill_src, os.path.join(out_dir, "skill.md"))
116+
# Serve skill at site root (e.g. https://dstack.ai/skill.md) from skills/dstack/SKILL.md
117+
shutil.copy2(skill_src, os.path.join(site_dir, "skill.md"))
115118

116119
index_path = os.path.join(site_dir, WELL_KNOWN_SKILLS_DIR, "index.json")
117120
index = {"skills": [{"name": name, "description": description[:1024], "files": ["skill.md"]}]}

docs/skill.md renamed to skills/dstack/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: dstack
3-
description: >-
3+
description: |
44
dstack is an open-source control plane for GPU provisioning and orchestration across GPU clouds, Kubernetes, and on-prem clusters.
55
---
66

0 commit comments

Comments
 (0)