Skip to content

Commit f3553e9

Browse files
author
Nikolai Rodionov
committed
fix: do not add ancestors if page is in the root
1 parent 85cc3f5 commit f3553e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mkdocs_with_confluence/plugin.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,10 @@ def add_page(self, page_name, parent_page_id, page_content_in_storage_format):
357357
"type": "page",
358358
"title": page_name,
359359
"space": {"key": space},
360-
"ancestors": [{"id": parent_page_id}],
361360
"body": {"storage": {"value": page_content_in_storage_format, "representation": "storage"}},
362361
}
362+
if parent_page_id:
363+
data["ancestors"] = [{"id": parent_page_id}]
363364
logger.debug(f"DATA: {data}")
364365
if not self.dryrun:
365366
try:

0 commit comments

Comments
 (0)