File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/ansys_sphinx_theme/extension Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -186,15 +186,18 @@ def link_code(app: Sphinx, doctree: Node):
186186 github_source = html_context .get ("source_path" , "" )
187187 github_version = html_context .get ("github_version" , "main" )
188188
189- if hasattr (env .config , "link_code_library" ):
189+ if getattr (env .config , "link_code_library" ):
190190 library = getattr (env .config , "link_code_library" )
191- github_source = getattr (env .config , "link_code_source" , github_source )
192- github_version = getattr (env .config , "link_code_branch" , github_version )
191+
193192 elif github_user and github_repo :
194193 library = f"{ github_user } /{ github_repo } "
195194
196195 else :
197196 raise AttributeError ("The library should have either html_context or link_code_library." )
197+
198+ github_source = getattr (env .config , "link_code_source" , github_source )
199+ github_version = getattr (env .config , "link_code_branch" , github_version )
200+
198201 if not library :
199202 raise AttributeError (
200203 "The conf.py file either should have html_context or link_code_library with github_repo and github_user." # noqa: E501
You can’t perform that action at this time.
0 commit comments