From 3eb04b1a2bdf9e53231fe862cfd76327371a9741 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sat, 12 Sep 2026 11:24:17 +0300 Subject: Initial multi-tenant blog host Go + Postgres application serving a management dashboard on the base domain and one public blog per subdomain. Markdown posts organised in pages, form-based theme customisation, image uploads stored in Postgres, JWT cookie sessions with CSRF, superadmin user management, RSS feeds. Docker/compose deployment and a Makefile-driven dev environment with seed data. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/confirm.html | 17 +++++ internal/web/templates/dashboard/design.html | 87 +++++++++++++++++++++++++ internal/web/templates/dashboard/images.html | 22 +++++++ internal/web/templates/dashboard/overview.html | 35 ++++++++++ internal/web/templates/dashboard/page_form.html | 21 ++++++ internal/web/templates/dashboard/pages.html | 24 +++++++ internal/web/templates/dashboard/password.html | 13 ++++ internal/web/templates/dashboard/post_form.html | 26 ++++++++ internal/web/templates/dashboard/posts.html | 25 +++++++ internal/web/templates/dashboard/settings.html | 13 ++++ 10 files changed, 283 insertions(+) create mode 100644 internal/web/templates/dashboard/confirm.html create mode 100644 internal/web/templates/dashboard/design.html create mode 100644 internal/web/templates/dashboard/images.html create mode 100644 internal/web/templates/dashboard/overview.html create mode 100644 internal/web/templates/dashboard/page_form.html create mode 100644 internal/web/templates/dashboard/pages.html create mode 100644 internal/web/templates/dashboard/password.html create mode 100644 internal/web/templates/dashboard/post_form.html create mode 100644 internal/web/templates/dashboard/posts.html create mode 100644 internal/web/templates/dashboard/settings.html (limited to 'internal/web/templates/dashboard') diff --git a/internal/web/templates/dashboard/confirm.html b/internal/web/templates/dashboard/confirm.html new file mode 100644 index 0000000..eefa1da --- /dev/null +++ b/internal/web/templates/dashboard/confirm.html @@ -0,0 +1,17 @@ +{{define "title"}}Confirm · Blogspace{{end}} +{{define "content"}} +
+

Are you sure?

+ {{if .Data.isHome}} +

This is the home page; it cannot be deleted. Make another page the home page first.

+

Back

+ {{else}} +

You are about to permanently delete {{.Data.what}}. This cannot be undone.

+
+ + + Cancel +
+ {{end}} +
+{{end}} diff --git a/internal/web/templates/dashboard/design.html b/internal/web/templates/dashboard/design.html new file mode 100644 index 0000000..27ce3c7 --- /dev/null +++ b/internal/web/templates/dashboard/design.html @@ -0,0 +1,87 @@ +{{define "title"}}Design · {{.Blog.Title}}{{end}} +{{define "content"}} +{{$t := .Data.theme}} +

Design

+

Save, then refresh your blog ↗ to see the result. Colours are hex values like #336699.

+
+ + +
+

Background

+
+ + +
+ {{template "imagepick" (dict "name" "bg_image" "current" $t.BgImage "images" .Data.images "label" "Background image")}} +
+ +
+

Text & content area

+
+ + + +
+
+ + + +
+
+ +
+

Header

+
+ + + +
+ + {{template "imagepick" (dict "name" "header_image" "current" $t.HeaderImage "images" .Data.images "label" "Header image (banner)")}} +
+ +
+

Menu

+
+ + + +
+ +
+ +
+

Footer

+ +
+ + +
+
+ +

+
+{{end}} diff --git a/internal/web/templates/dashboard/images.html b/internal/web/templates/dashboard/images.html new file mode 100644 index 0000000..5383e73 --- /dev/null +++ b/internal/web/templates/dashboard/images.html @@ -0,0 +1,22 @@ +{{define "title"}}Images · {{.Blog.Title}}{{end}} +{{define "content"}} +

Images

+
+
+ + + +
+
+

To put an image in a post, copy its Markdown line into the post text.

+ +{{end}} diff --git a/internal/web/templates/dashboard/overview.html b/internal/web/templates/dashboard/overview.html new file mode 100644 index 0000000..0ec72e6 --- /dev/null +++ b/internal/web/templates/dashboard/overview.html @@ -0,0 +1,35 @@ +{{define "title"}}{{.Blog.Title}} · Blogspace{{end}} +{{define "content"}} +

{{.Blog.Title}}

+

Your blog is live at {{.BlogURL}}. Every change you save here shows up there as soon as you refresh.

+ +
+ +
+

Pages

+
    + {{range .Data.pages}}
  • {{.Title}} ({{.PostCount}} posts{{if .IsHome}}, home{{end}}{{if not .ShowInNav}}, hidden from menu{{end}})
  • {{end}} +
+
+
+ +
+

Latest posts

+ {{if .Data.posts}} + + + {{range .Data.posts}} + + + + + {{end}} +
TitlePageDate
{{.Title}}{{if not .Published}} hidden{{end}}{{.PageTitle}}{{date .CreatedAt}}view ↗
+

All posts

+ {{else}}

No posts yet. Write the first one.

{{end}} +
+{{end}} diff --git a/internal/web/templates/dashboard/page_form.html b/internal/web/templates/dashboard/page_form.html new file mode 100644 index 0000000..df94c7e --- /dev/null +++ b/internal/web/templates/dashboard/page_form.html @@ -0,0 +1,21 @@ +{{define "title"}}{{if .Data.page.ID}}Edit page{{else}}New page{{end}} · {{.Blog.Title}}{{end}} +{{define "content"}} +
+

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

+
+ + + + + +

+ + {{if .Data.page.ID}}View page ↗{{end}} + Back to pages +

+
+
+{{template "mdhelp"}} +{{end}} diff --git a/internal/web/templates/dashboard/pages.html b/internal/web/templates/dashboard/pages.html new file mode 100644 index 0000000..6703e7f --- /dev/null +++ b/internal/web/templates/dashboard/pages.html @@ -0,0 +1,24 @@ +{{define "title"}}Pages · {{.Blog.Title}}{{end}} +{{define "content"}} +

Pages + New page

+

Pages appear in your blog's menu in this order. Each page holds its own list of posts.

+
+ + + {{range .Data.pages}} + + + + + + {{end}} +
Menu orderTitleAddressPosts
+
+
+
{{.Title}} + {{if .IsHome}}home{{end}}{{if not .ShowInNav}}hidden{{end}}{{if .IsHome}}/{{else}}/{{.Slug}}{{end}} ↗{{.PostCount}} + {{if not .IsHome}}
+ delete{{end}} +
+
+{{end}} diff --git a/internal/web/templates/dashboard/password.html b/internal/web/templates/dashboard/password.html new file mode 100644 index 0000000..f333bd7 --- /dev/null +++ b/internal/web/templates/dashboard/password.html @@ -0,0 +1,13 @@ +{{define "title"}}Change password · Blogspace{{end}} +{{define "content"}} +
+

Change password

+
+ + + + + +
+
+{{end}} diff --git a/internal/web/templates/dashboard/post_form.html b/internal/web/templates/dashboard/post_form.html new file mode 100644 index 0000000..520b9e6 --- /dev/null +++ b/internal/web/templates/dashboard/post_form.html @@ -0,0 +1,26 @@ +{{define "title"}}{{if .Data.post.ID}}Edit post{{else}}New post{{end}} · {{.Blog.Title}}{{end}} +{{define "content"}} +
+

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

+
+ + +
+ + +
+ + +

+ + {{if .Data.post.ID}}View post ↗{{end}} + Back to posts +

+
+
+{{template "mdhelp"}} +{{end}} diff --git a/internal/web/templates/dashboard/posts.html b/internal/web/templates/dashboard/posts.html new file mode 100644 index 0000000..24e86bb --- /dev/null +++ b/internal/web/templates/dashboard/posts.html @@ -0,0 +1,25 @@ +{{define "title"}}Posts · {{.Blog.Title}}{{end}} +{{define "content"}} +

Posts + New post

+
+ + +
+
+{{if .Data.posts}} + + + {{range .Data.posts}} + + + + + {{end}} +
TitlePageDate
{{.Title}}{{if not .Published}} hidden{{end}}{{.PageTitle}}{{date .CreatedAt}}view ↗ · delete
+{{else}}

No posts here yet.

{{end}} +
+{{end}} diff --git a/internal/web/templates/dashboard/settings.html b/internal/web/templates/dashboard/settings.html new file mode 100644 index 0000000..24dffb4 --- /dev/null +++ b/internal/web/templates/dashboard/settings.html @@ -0,0 +1,13 @@ +{{define "title"}}Settings · {{.Blog.Title}}{{end}} +{{define "content"}} +
+

Blog settings

+
+ + + +

Address: {{.BlogURL}} — only the administrator can change this.

+ +
+
+{{end}} -- cgit v1.2.3