Get started!
- -Name your site
- +Enter a domain name
- +Choose a Theme
-Choose a Theme
+Cooking your Anna site
-Your Anna site is being cooked. This page will reload...
-diff --git a/cmd/anna/theme.go b/cmd/anna/theme.go index 512182d..1ed7d24 100644 --- a/cmd/anna/theme.go +++ b/cmd/anna/theme.go @@ -12,7 +12,7 @@ import ( var ( baseURL = "https://github.com/anna-ssg/themes/releases/download" - tagVer = "v2.0" + tagVer = "v3.0" destDir = "site" ) diff --git a/cmd/anna/wizard.go b/cmd/anna/wizard.go index dd9b462..89200f4 100644 --- a/cmd/anna/wizard.go +++ b/cmd/anna/wizard.go @@ -58,7 +58,7 @@ func (ws *WizardServer) handleSubmit(w http.ResponseWriter, r *http.Request) { ws.ErrorLogger.Println("Method not allowed") return } - + // got the form data, now ask theme.go to unzip and place in current dir var config parser.LayoutConfig err := json.NewDecoder(r.Body).Decode(&config) @@ -67,6 +67,13 @@ func (ws *WizardServer) handleSubmit(w http.ResponseWriter, r *http.Request) { ws.ErrorLogger.Println(err) return } + // Call DownloadTheme function from theme.go + err = DownloadTheme(config.ThemeURL) + if err != nil { + http.Error(w, "Internal server error", http.StatusInternalServerError) + ws.ErrorLogger.Println("Error downloading and extracting theme:", err) + return + } FormSubmittedCh <- struct{}{} } diff --git a/site/static/wizard/index.html b/site/static/wizard/index.html index 9c022cf..f3aba86 100644 --- a/site/static/wizard/index.html +++ b/site/static/wizard/index.html @@ -22,15 +22,20 @@