From f3553e9dfd64468fce31ad7c6fc6ca421d7e81f0 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Feb 2023 16:34:54 +0100 Subject: [PATCH] fix: do not add ancestors if page is in the root --- mkdocs_with_confluence/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkdocs_with_confluence/plugin.py b/mkdocs_with_confluence/plugin.py index 05af766..3136448 100644 --- a/mkdocs_with_confluence/plugin.py +++ b/mkdocs_with_confluence/plugin.py @@ -357,9 +357,10 @@ class MkdocsWithConfluence(BasePlugin): "type": "page", "title": page_name, "space": {"key": space}, - "ancestors": [{"id": parent_page_id}], "body": {"storage": {"value": page_content_in_storage_format, "representation": "storage"}}, } + if parent_page_id: + data["ancestors"] = [{"id": parent_page_id}] logger.debug(f"DATA: {data}") if not self.dryrun: try: