Phase 6 part 5, step 2: start a new site

Sites → New site fills an empty Gitea repository with the theme, a
hugo.toml in the site's brand and a starter home page: checked that the
repository is empty and builds with Hugo, then the first commit is pushed
to its default branch. The site joins the profile, and a First pages card
builds its Home, About, Contact and product pages with the page builder;
About and Contact join the top menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:27:22 -07:00
co-authored by Claude Opus 5.5
parent 5d7db5c5bf
commit 9ca09c1ffa
18 changed files with 709 additions and 7 deletions
+9 -4
View File
@@ -44,10 +44,15 @@ func (s *Server) gitea() *gitea.Client {
func (s *Server) applier(site seoSite) *seo.Applier {
p, _ := profile.Load(s.DB)
var repo, branch string
if p != nil && site.Index < len(p.Websites) {
if p != nil && site.Index >= 0 && site.Index < len(p.Websites) {
repo, branch = p.Websites[site.Index].Repo, p.Websites[site.Index].Branch
}
author := "Supermarket <supermarket@localhost>"
return &seo.Applier{Gitea: s.gitea(), Repo: repo, Branch: branch, ReposDir: filepath.Join(s.DataDir, "sites"), Author: s.commitAuthor()}
}
// commitAuthor is who Supermarket's commits are by: the Core's user, via
// Supermarket.
func (s *Server) commitAuthor() string {
if s.Core != nil && s.Core.Email != "" {
name := s.Core.Name
if name == "" {
@@ -55,9 +60,9 @@ func (s *Server) applier(site seoSite) *seo.Applier {
} else {
name += " (via Supermarket)"
}
author = name + " <" + s.Core.Email + ">"
return name + " <" + s.Core.Email + ">"
}
return &seo.Applier{Gitea: s.gitea(), Repo: repo, Branch: branch, ReposDir: filepath.Join(s.DataDir, "sites"), Author: author}
return "Supermarket <supermarket@localhost>"
}
func (s *Server) proposer() (*seo.Proposer, error) {