From 0fb4509e093ee8a8144ad9c420563aa95f2847e0 Mon Sep 17 00:00:00 2001 From: Levente Hunyadi Date: Thu, 10 Oct 2024 21:28:44 +0200 Subject: [PATCH] Fix an issue with how a parent page is assumed --- md2conf/application.py | 8 ++++---- md2conf/processor.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/md2conf/application.py b/md2conf/application.py index 2790cf0..c91ed4e 100644 --- a/md2conf/application.py +++ b/md2conf/application.py @@ -99,15 +99,15 @@ def _index_directory( continue if entry.is_file(): - files.append((Path(local_dir) / entry.name).absolute()) + files.append(Path(local_dir) / entry.name) elif entry.is_dir(): - directories.append((Path(local_dir) / entry.name).absolute()) + directories.append(Path(local_dir) / entry.name) # make page act as parent node in Confluence parent_id: Optional[ConfluenceQualifiedID] = None - if "index.md" in files: + if (Path(local_dir) / "index.md") in files: parent_id = read_qualified_id(Path(local_dir) / "index.md") - elif "README.md" in files: + elif (Path(local_dir) / "README.md") in files: parent_id = read_qualified_id(Path(local_dir) / "README.md") if parent_id is None: diff --git a/md2conf/processor.py b/md2conf/processor.py index 26bb30f..52e9d6a 100644 --- a/md2conf/processor.py +++ b/md2conf/processor.py @@ -79,9 +79,9 @@ def _index_directory( continue if entry.is_file(): - files.append((Path(local_dir) / entry.name).absolute()) + files.append(Path(local_dir) / entry.name) elif entry.is_dir(): - directories.append((Path(local_dir) / entry.name).absolute()) + directories.append(Path(local_dir) / entry.name) for doc in files: metadata = self._get_page(doc)