From 24b04a11f215d898cf95bcc6c0316b3d25e2b35f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 16 Apr 2026 08:55:32 +0300 Subject: v0.2.0: markdown image embedding, post typography, modal improvements Amp-Thread-ID: https://ampcode.com/threads/T-019d94cc-99a9-74af-8f3d-9521cd73324f Co-authored-by: Amp --- internal/processor/processor.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/processor') diff --git a/internal/processor/processor.go b/internal/processor/processor.go index c600c0d..43f5023 100644 --- a/internal/processor/processor.go +++ b/internal/processor/processor.go @@ -187,6 +187,14 @@ func buildMarkdownPost(srcPath, postDir, id string) (*post.Post, []string, error return nil, nil, err } + // Rewrite bare image filenames to site-root-relative paths so they + // resolve correctly in the generated HTML (e.g. "img.png" → "posts/ID/img.png"). + for _, name := range localImages { + html = strings.ReplaceAll(html, + fmt.Sprintf(`src="%s"`, name), + fmt.Sprintf(`src="posts/%s/%s"`, id, name)) + } + inboxExtras := make([]string, 0, len(localImages)) for _, name := range localImages { inboxExtras = append(inboxExtras, filepath.Join(sourceDir, name)) -- cgit v1.2.3