From 5ad1a4abe552cb443204bd7194d137673197799f Mon Sep 17 00:00:00 2001 From: Joel Andritsch Date: Fri, 22 Apr 2022 04:16:46 -0500 Subject: [PATCH] bugfix: Force pages to default width. (#175) This change is to compensate for an API bug in Confluence where newly create pages end up getting a random width of either "fixed" or "full". Fixes #173 --- pkg/confluence/api.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/confluence/api.go b/pkg/confluence/api.go index 2930851..40455ed 100644 --- a/pkg/confluence/api.go +++ b/pkg/confluence/api.go @@ -552,6 +552,16 @@ func (api *API) UpdatePage( }, "metadata": map[string]interface{}{ "labels": labels, + // The Confluence API randomly sets page width for some reason: + // https://community.developer.atlassian.com/t/confluence-rest-api-create-content-at-random-width/57001 + + // This is a workaround to compensate for that bug. It forces the page to be created + // with the default appearance, which is "fixed" (not full-width). + "properties": map[string]interface{}{ + "content-appearance-published": map[string]interface{}{ + "value": "default", + }, + }, }, }