Phase 5 part 2: preview any branch of a site
Sites → Previews builds a branch with Hugo (drafts included) and serves it under /preview/<site>/<branch>/, links rewritten to stay inside, behind a sandboxing CSP so a branch's scripts can't act on the app or phone home. The image now builds Hugo v0.170.1 from source; Alpine's 0.147.2 couldn't build the site. Hugo's errors show their innermost cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,13 @@ func (s *Server) Handler() (http.Handler, error) {
|
||||
mux.HandleFunc("POST /metrics/customers/{id}", s.metricsCustomerMatch)
|
||||
mux.HandleFunc("GET /sites", s.sitesPage)
|
||||
mux.HandleFunc("POST /sites/sync", s.sitesSync)
|
||||
mux.HandleFunc("GET /sites/previews", s.sitesPreviewsPage)
|
||||
mux.HandleFunc("POST /sites/previews/build", s.sitesPreviewBuild)
|
||||
mux.HandleFunc("POST /sites/previews/delete", s.sitesPreviewDelete)
|
||||
mux.HandleFunc("GET /preview/{site}/{slug}/{path...}", s.previewServe)
|
||||
mux.HandleFunc("GET /preview/{site}/{slug}", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, r.URL.Path+"/", http.StatusMovedPermanently)
|
||||
})
|
||||
mux.HandleFunc("GET /seo", s.seoPage)
|
||||
mux.HandleFunc("GET /seo/check", s.seoCheckPage)
|
||||
mux.HandleFunc("GET /seo/engines", s.seoEnginesPage)
|
||||
|
||||
Reference in New Issue
Block a user