diff --git a/scripts.py b/scripts.py index 625d8db..12dc4f7 100644 --- a/scripts.py +++ b/scripts.py @@ -141,7 +141,7 @@ def generate_docusaurus(): content = f.read_text(encoding="utf-8") safe_content = clean_mdx_content(content) rel_path = f.relative_to(input) - dest_path = out / rel_path.with_suffix(".md") + dest_path = out / rel_path.parent / rel_path.stem / "index.md" dest_path.parent.mkdir(parents=True, exist_ok=True) dest_path.write_text(safe_content, encoding="utf-8") diff --git a/templates/docusaurus/module.html.jinja2 b/templates/docusaurus/module.html.jinja2 index 8033247..d22edfc 100644 --- a/templates/docusaurus/module.html.jinja2 +++ b/templates/docusaurus/module.html.jinja2 @@ -17,7 +17,7 @@ {% if module.submodules %} ## Submodules {% for submodule in module.submodules if is_public(submodule) | trim %} -- [{{ submodule.name }}](./{{ submodule.name }}) +- [{{ submodule.name }}]({{ module.name }}/{{ submodule.name }}) {% endfor %} {% endif %} {% endblock %}