Skip to content

Commit bc3a135

Browse files
committed
update docs
1 parent 088fd97 commit bc3a135

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

docs/en/conf.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def setup(app):
3030
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3131

3232
html_theme = 'sphinx_rtd_theme'
33+
html_static_path = ['_static']
3334

3435
html_theme_options = {
3536
'display_version': True,
@@ -50,4 +51,14 @@ def setup(app):
5051
'js/include_html.js' # 如果需要引入其他 JavaScript 文件
5152
]
5253

53-
html_static_path = ['_static']
54+
# -- GitHub 相关配置 ---------------------------------------------------
55+
html_context = {
56+
# GitHub 仓库设置(必需)
57+
"display_github": True, # 启用 GitHub 链接
58+
"github_user": "tuya", # 组织/用户名
59+
"github_repo": "TuyaOpen", # 仓库名
60+
"github_version": "master", # 默认分支(如 main/master)
61+
62+
# 页面路径配置(自动生成编辑链接)
63+
"conf_py_path": "/docs/en/", # 配置文件的仓库相对路径
64+
}

docs/zh/conf.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def setup(app):
3030
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3131

3232
html_theme = 'sphinx_rtd_theme'
33+
html_static_path = ['_static']
3334

3435
html_theme_options = {
3536
'display_version': True,
@@ -50,4 +51,14 @@ def setup(app):
5051
'js/include_html.js' # 如果需要引入其他 JavaScript 文件
5152
]
5253

53-
html_static_path = ['_static']
54+
# -- GitHub 相关配置 ---------------------------------------------------
55+
html_context = {
56+
# GitHub 仓库设置(必需)
57+
"display_github": True, # 启用 GitHub 链接
58+
"github_user": "tuya", # 组织/用户名
59+
"github_repo": "TuyaOpen", # 仓库名
60+
"github_version": "master", # 默认分支(如 main/master)
61+
62+
# 页面路径配置(自动生成编辑链接)
63+
"conf_py_path": "/docs/zh/", # 配置文件的仓库相对路径
64+
}

0 commit comments

Comments
 (0)