{{/* post_form.html — 发帖页 + 编辑帖页(共用模板) 定义两个入口,均调用内部 post-form-inner: post-new-page → PagePostNew handler post-edit-page → PagePostEdit handler 数据:utils.PostFormData .IsEdit bool — true=编辑模式 .PID uint64 — 编辑时帖子 ID .HID uint64 — 当前选中版块 .Title string — 编辑时预填标题 .Content string — 编辑时预填内容(Markdown 原文) .Helps []HelpPageItem — 版块选择列表 EasyMDE: 通过 editor.html 公共组件引入(editor-css / editor-js / editor-init-func) 表单提交方式: 使用 JS fetch(非 HTMX),因为需要从 EasyMDE 读取内容 POST JSON 到 /api/post/new 或 /api/post/edit credentials: 'include' 携带 hp_session Cookie(无需 localStorage token) */}} {{define "post-new-page"}}{{template "post-form-inner" .}}{{end}} {{define "post-edit-page"}}{{template "post-form-inner" .}}{{end}} {{define "post-form-inner"}}
{{template "editor-css"}} {{template "hp-head" .}}