diff options
| author | grm <grm@eyesin.space> | 2026-09-15 23:12:51 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-15 23:12:51 +0300 |
| commit | 2c85ca1a46ddf4652f8fffc53d6bcfbe32b2b4ff (patch) | |
| tree | ecd5efd574b7d7463e4b2c4361c1994c4f28f561 /internal/web/templates/dashboard/post_form.html | |
| parent | 55732bdfc25933bab26220ccd82fe5e172d9e673 (diff) | |
| download | blogspace-2c85ca1a46ddf4652f8fffc53d6bcfbe32b2b4ff.tar.gz blogspace-2c85ca1a46ddf4652f8fffc53d6bcfbe32b2b4ff.tar.bz2 blogspace-2c85ca1a46ddf4652f8fffc53d6bcfbe32b2b4ff.zip | |
Add post tags, with a tag page and two side-column modules
Posts can now carry tags, set on the post form as a checklist of the
blog's existing tags plus a comma-separated box for new ones (no JS).
A tag is a name and a unique slug, so "Go" and "go" are one tag and
Greek tags get readable URLs; tags no post uses any more are deleted.
On the blog, tags appear under the post date and link to /tag/<slug>,
which lists the published posts from every page, paginated like a page.
Two new layout modules show them: a Tags list (with counts, by use) and
a Tag cloud (alphabetical, sized by use). Both are only fetched when a
visible module needs them.
The article loop and pager move to a shared postlist partial; while
there, the pager stops adding a trailing slash — /news/?p=2 was a 404
because a {page} wildcard never matches one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/templates/dashboard/post_form.html')
| -rw-r--r-- | internal/web/templates/dashboard/post_form.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/web/templates/dashboard/post_form.html b/internal/web/templates/dashboard/post_form.html index 9f188f7..fd47615 100644 --- a/internal/web/templates/dashboard/post_form.html +++ b/internal/web/templates/dashboard/post_form.html @@ -14,6 +14,11 @@ <label>{{t "Date"}}<br> <input type="datetime-local" name="posted_at" value="{{.Data.post.CreatedAt.Format "2006-01-02T15:04"}}" placeholder="YYYY-MM-DD HH:MM"></label> </div> + {{if .Data.allTags}}<p class="lbl">{{t "Tags"}}</p> + <div class="tagpick">{{range .Data.allTags}}<label class="check"><input type="checkbox" name="tag" value="{{.Name}}"{{if index $.Data.tagged .Slug}} checked{{end}}> {{.Name}}</label>{{end}}</div>{{end}} + <label>{{if .Data.allTags}}{{t "New tags"}}{{else}}{{t "Tags"}}{{end}} <span class="muted">({{t "comma-separated"}})</span><br> + <input name="new_tags" value="{{.Data.newTags}}" maxlength="900" placeholder="{{t "go, tomatoes, recipes"}}"></label> + <p class="muted small">{{t "Tags on hidden posts are not shown on the blog; a tag nobody uses disappears."}}</p> <label for="ed-body">{{t "Content"}} <span class="muted">(Markdown)</span></label> {{template "editor" (dict "name" "body" "value" .Data.post.BodyMD "rows" 24 "tall" true "upload" (print "/b/" .Blog.Subdomain "/files/upload") "preview" (print "/b/" .Blog.Subdomain "/preview") "csrf" .CSRF)}} <label class="check"><input type="checkbox" name="published"{{if .Data.post.Published}} checked{{end}}> {{t "Visible on the blog"}}</label> |
