diff options
| author | grm <grm@eyesin.space> | 2026-09-17 16:42:15 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-17 16:42:15 +0300 |
| commit | d0601f06c080a8eb8d781fdd0e3338cd7ed42690 (patch) | |
| tree | 1931e4312ee2db15dfd0a99583c8ebadf0393e2b /internal/db/migrations/blog | |
| parent | 4a6f987bf7f9d73e9dd33d225fd2d73e9bf69a88 (diff) | |
| download | blogspace-d0601f06c080a8eb8d781fdd0e3338cd7ed42690.tar.gz blogspace-d0601f06c080a8eb8d781fdd0e3338cd7ed42690.tar.bz2 blogspace-d0601f06c080a8eb8d781fdd0e3338cd7ed42690.zip | |
Add post summaries, featured images and a page outro
Recreating gizmolab.net as a blog showed three things the design system
could not express, all of them ordinary blog features:
- Listings can show a summary and a "Read more" link instead of the whole
post (theme.list_style). The summary is the source up to <!--more-->;
without the marker a Markdown post is cut at a block boundary after 70
words (never inside a code fence) and an HTML post is shown whole, since
cutting hand-written markup blind would leave tags open. Computed at
render time (Post.Excerpt/HasMore), nothing new is stored.
- A post can carry a featured image (posts.image, a library file that is
unset when the file is deleted): a thumbnail floated beside the entry on
listings, and on the post page above or below the text, or not at all,
as theme.post_image says. The picker is the design page's imagepick; its
library panel moves out of design.html into partials/imagelib.html so
both forms share it — which also removes a stale pickAction call the
design form's click handler would have hit.
- A page can have a closing text after its posts (pages.outro_md/html), in
the intro's format: the per-page counterpart of the blog-wide "after the
posts" module, for a home page that ends in a site map or a widget. The
editor partial takes formatof to share another editor's Format row, and
its upload field is now <name>_file so two editors fit in one form.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/db/migrations/blog')
| -rw-r--r-- | internal/db/migrations/blog/00007_post_image.sql | 7 | ||||
| -rw-r--r-- | internal/db/migrations/blog/00008_page_outro.sql | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/internal/db/migrations/blog/00007_post_image.sql b/internal/db/migrations/blog/00007_post_image.sql new file mode 100644 index 0000000..75858a4 --- /dev/null +++ b/internal/db/migrations/blog/00007_post_image.sql @@ -0,0 +1,7 @@ +-- +goose Up +-- A post's featured image: a library image shown as a thumbnail on listings +-- and on the post page. Deleting the file just unsets it. +ALTER TABLE posts ADD COLUMN image uuid REFERENCES files(id) ON DELETE SET NULL; + +-- +goose Down +ALTER TABLE posts DROP COLUMN image; diff --git a/internal/db/migrations/blog/00008_page_outro.sql b/internal/db/migrations/blog/00008_page_outro.sql new file mode 100644 index 0000000..e795df0 --- /dev/null +++ b/internal/db/migrations/blog/00008_page_outro.sql @@ -0,0 +1,9 @@ +-- +goose Up +-- A page can carry text after its posts as well as before them, in the same +-- format as the intro (one format column per page). +ALTER TABLE pages + ADD COLUMN outro_md text NOT NULL DEFAULT '', + ADD COLUMN outro_html text NOT NULL DEFAULT ''; + +-- +goose Down +ALTER TABLE pages DROP COLUMN outro_md, DROP COLUMN outro_html; |
