From 16f72b00bd57d9938661095fad302575f1334d45 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Tue, 6 Jan 2026 13:53:59 +0100 Subject: [PATCH] feat: extend link resolution to support blog posts Previously, relative markdown links only resolved to Confluence pages. Now the lookup also searches for blog posts if a page is not found, enabling links like [My Blog](./blog-post.md) to work correctly. --- page/link.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/page/link.go b/page/link.go index c5f8b1d..c4ceab2 100644 --- a/page/link.go +++ b/page/link.go @@ -202,17 +202,27 @@ func parseLinks(markdown string) []markdownLink { return links } -// getConfluenceLink builds a stable Confluence tiny link for the given page. +// getConfluenceLink builds a stable Confluence tiny link for the given page or blog post. // Tiny links use the format {baseURL}/x/{encodedPageID} and are immune to // Cloud-specific URL variations like /ex/confluence//wiki/... func getConfluenceLink( api *confluence.API, space, title string, ) (string, error) { + // Try to find as a page first page, err := api.FindPage(space, title, "page") if err != nil { return "", karma.Format(err, "api: find page") } + + // If not found as a page, try to find as a blog post + if page == nil { + page, err = api.FindPage(space, title, "blogpost") + if err != nil { + return "", karma.Format(err, "api: find blogpost") + } + } + if page == nil { return "", nil }