Skip to content

Commit f5301ca

Browse files
SilverRainZMiMoCode
andcommitted
fix: Filter out docs outside srcdir in path2doc
Co-authored-by: MiMoCode <mimo@xiaomi.com>
1 parent caea7d4 commit f5301ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/sphinxnotes/recentupdate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def get_git_revisions(
191191

192192
def path2doc(repo: Repo, env: BuildEnvironment, blob_path: str) -> str | None:
193193
"""Convert a git repo-relative blob path to a Sphinx document name. """
194-
return env.path2doc(path.join(repo.working_dir, blob_path))
194+
docname = env.path2doc(path.join(repo.working_dir, blob_path))
195+
return docname if (docname and not path.isabs(docname)) else None
195196

196197

197198
@extra_context('recentupdate')

0 commit comments

Comments
 (0)