diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-16 08:55:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-16 08:55:32 +0300 |
| commit | 24b04a11f215d898cf95bcc6c0316b3d25e2b35f (patch) | |
| tree | eb41ea0ca0a2ef98442328018a48cebed81ffd54 /internal/processor | |
| parent | df6f3928bd4f093a1745fb9408430a08ac21ea9c (diff) | |
v0.2.0: markdown image embedding, post typography, modal improvementsv0.2.0
Amp-Thread-ID: https://ampcode.com/threads/T-019d94cc-99a9-74af-8f3d-9521cd73324f
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/processor')
| -rw-r--r-- | internal/processor/processor.go | 8 |
1 files changed, 8 insertions, 0 deletions
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)) |
