Skip to content

Commit

Permalink
Fix an issue with how a parent page is assumed
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadi committed Oct 10, 2024
1 parent e436621 commit 0fb4509
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions md2conf/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions md2conf/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0fb4509

Please sign in to comment.