diff --git a/app.go b/app.go index 65a6db4..6d33c94 100644 --- a/app.go +++ b/app.go @@ -139,6 +139,12 @@ func hugoNewSite(w http.ResponseWriter, r *http.Request) { w.Write([]byte(fmt.Sprintf("unable to clone 'nostyleplease' theme: %s", err))) } + sites, err := existingSites() + if err != nil { + w.Write([]byte(fmt.Sprintf("unable to list existing sites: %s", err))) + } + + templ.Handler(components.Homepage(sites)).ServeHTTP(w, r) } // NewRouter creates a new web router. diff --git a/components/templates.templ b/components/templates.templ index 7aa67b7..8df89ee 100644 --- a/components/templates.templ +++ b/components/templates.templ @@ -15,7 +15,8 @@ templ Homepage(sites []string) { }
Create a new Hugo site below 👇
-
+ +

Creating new site...

} diff --git a/components/templates_templ.go b/components/templates_templ.go index bd8484d..ae52446 100644 --- a/components/templates_templ.go +++ b/components/templates_templ.go @@ -65,7 +65,7 @@ func Homepage(sites []string) templ.Component { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Create a new Hugo site below 👇
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Create a new Hugo site below 👇

Creating new site...

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }