You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Sphinx文档双独立侧边栏配置问题求助

问题求助:为Sphinx文档的index.html和source.html设置独立侧边栏

现有文件结构

  • main.rst
  • source.rst
  • source.file1.rst
  • source.file2.rst

当前配置与侧边栏表现

index.rst 内容

Welcome!
==========
.. toctree::
   :maxdepth: 1

   main
   source

index.html左侧边栏显示:main、source

source.rst 内容

Source
==========
.. toctree::
   :maxdepth: 1

   source.file1
   source.file2

source.html左侧边栏显示:main、source(嵌套file1和file2)

conf.py 相关配置

html_sidebars = {
   '**': [
      'localtoc.html',
      'globaltoc.html'
   ],
}

需求

需要让index.html和source.html拥有完全独立的侧边栏,但调整localtoc.html和globaltoc.html后仍未解决问题,寻求可行方案。

内容的提问来源于stack exchange,提问作者Peter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 01:03:09