summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-16 08:55:32 +0300
committerPaul Buetow <paul@buetow.org>2026-04-16 08:55:32 +0300
commit24b04a11f215d898cf95bcc6c0316b3d25e2b35f (patch)
treeeb41ea0ca0a2ef98442328018a48cebed81ffd54
parentdf6f3928bd4f093a1745fb9408430a08ac21ea9c (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>
-rw-r--r--internal/generator/shared.go11
-rw-r--r--internal/processor/processor.go8
-rw-r--r--internal/version/version.go2
3 files changed, 19 insertions, 2 deletions
diff --git a/internal/generator/shared.go b/internal/generator/shared.go
index 9b927f7..11dbeed 100644
--- a/internal/generator/shared.go
+++ b/internal/generator/shared.go
@@ -76,7 +76,7 @@ const navDefs = `
the expanded post. Theme-specific modal-inner keeps its own background. */
.post-modal { background:rgba(0,0,0,0.55) !important; backdrop-filter:blur(6px) !important; }
#post-modal.active { display:flex !important; align-items:center; justify-content:center; }
-#post-modal .modal-inner { width:min(100%, 800px); max-height:calc(100vh - 80px); overflow-y:auto; margin:0 auto !important; }
+#post-modal .modal-inner { width:fit-content; max-width:min(100%, 90vw); max-height:calc(100vh - 80px); overflow:auto; margin:0 auto !important; }
/* Content area max-width across all themes */
.overlay { max-width:1200px; margin-left:auto; margin-right:auto; }
/* Pagination: newer + older in a footer bar (below scrollable posts, like the header) */
@@ -118,6 +118,15 @@ a.header-feed-link:hover { opacity:1; text-decoration:underline; }
#splash-overlay.splash-brutalist .splash-inner.splash-frame {
padding: clamp(1.4rem, 4.5vw, 2.25rem) clamp(1.1rem, 3.5vw, 1.9rem); background: rgba(0, 0, 0, 0.78); }
html.sno-splash-skip #splash-overlay { display:none !important; visibility:hidden !important; pointer-events:none !important; }
+/* Images embedded in markdown posts */
+.post-text img { max-width:100%; max-height:320px; object-fit:contain; border-radius:6px; cursor:pointer; }
+#post-modal .post-text img, #modal-content img { max-height:none; cursor:default; }
+/* Markdown post typography: restore spacing stripped by the global reset */
+.post-text p { margin:0.65em 0; }
+.post-text ul, .post-text ol { margin:0.65em 0; padding-left:1.8em; }
+.post-text li { margin:0.3em 0; }
+.post-text p:first-child { margin-top:0; }
+.post-text p:last-child, .post-text ul:last-child, .post-text ol:last-child { margin-bottom:0; }
{{end}}
{{define "navmodal"}}
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))
diff --git a/internal/version/version.go b/internal/version/version.go
index 3f21bc2..4e2512d 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -2,4 +2,4 @@
package version
// Version is the application version (semantic versioning).
-const Version = "0.1.6"
+const Version = "0.2.0"