From 2b450b66fee4906e746f6e04a6d07a72ff2faf64 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:26:17 +0300 Subject: Insert images straight from the Markdown editor A shared editor partial adds an "Insert image" file picker plus paste and drag-and-drop on the textarea; a few lines of inline JS upload the file to the existing images endpoint (which now answers JSON when asked) and put the Markdown at the caret. Without JS the same file rides along with the form and is appended to the text on save, so nothing depends on scripting. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/page_form.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/web/templates/dashboard/page_form.html') diff --git a/internal/web/templates/dashboard/page_form.html b/internal/web/templates/dashboard/page_form.html index 38aac71..2692449 100644 --- a/internal/web/templates/dashboard/page_form.html +++ b/internal/web/templates/dashboard/page_form.html @@ -2,13 +2,13 @@ {{define "content"}}

{{if .Data.page.ID}}Edit page{{else}}New page{{end}}

-
+ - + + {{template "editor" (dict "name" "intro" "value" .Data.page.IntroMD "rows" 8 "tall" false "upload" (print "/b/" .Blog.Subdomain "/images/upload") "csrf" .CSRF)}}

@@ -17,5 +17,4 @@

-{{template "mdhelp"}} {{end}} -- cgit v1.2.3