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:
@@ -15,6 +15,7 @@ import (
|
||||
"supermarket/internal/hugorepo"
|
||||
"supermarket/internal/profile"
|
||||
"supermarket/internal/sites"
|
||||
"supermarket/internal/theme"
|
||||
)
|
||||
|
||||
// siteRepo is a website with a Hugo repository, from the profile.
|
||||
@@ -100,6 +101,13 @@ func (s *Server) renderSites(w http.ResponseWriter, r *http.Request, errMsg stri
|
||||
cancel()
|
||||
}
|
||||
wc.Release()
|
||||
if raw, rerr := os.ReadFile(filepath.Join(wc.Dir, theme.Dir, "VERSION")); rerr == nil {
|
||||
data["Theme"] = strings.TrimSpace(string(raw))
|
||||
data["Kinds"] = []string{"home", "about", "contact"}
|
||||
if p, _ := profile.Load(s.DB); p != nil {
|
||||
data["Products"] = p.Products
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
errMsg = "Couldn't read the working copy: " + err.Error()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user