From 2cb3cc7c35051148ee90b6c308c74b204914a540 Mon Sep 17 00:00:00 2001 From: efim Date: Wed, 4 Oct 2023 09:13:12 +0000 Subject: [PATCH] feat: split results into insertable component still not fully sure how this all operates, but allright. --- 17-results-summary-component-go/main.go | 2 +- .../public/out.css | 4 ++ .../templates/index.gohtml | 45 +++++++++++++++++++ .../templates/summary-component.gohtml | 13 ++++-- 4 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 17-results-summary-component-go/templates/index.gohtml diff --git a/17-results-summary-component-go/main.go b/17-results-summary-component-go/main.go index 6e98b50..faeb693 100644 --- a/17-results-summary-component-go/main.go +++ b/17-results-summary-component-go/main.go @@ -60,7 +60,7 @@ func main() { // main page with results summary http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { templateName := "templates/summary-component.gohtml" - tmpl := template.Must(template.ParseFS(templates, templateName)) + tmpl := template.Must(template.ParseFS(templates, "templates/index.gohtml", templateName)) if err := tmpl.Execute(w, resultsData); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } diff --git a/17-results-summary-component-go/public/out.css b/17-results-summary-component-go/public/out.css index 1811410..6b43f3e 100644 --- a/17-results-summary-component-go/public/out.css +++ b/17-results-summary-component-go/public/out.css @@ -540,6 +540,10 @@ video { bottom: 0.25rem; } +.block { + display: block; +} + .flex { display: flex; } diff --git a/17-results-summary-component-go/templates/index.gohtml b/17-results-summary-component-go/templates/index.gohtml new file mode 100644 index 0000000..60a8726 --- /dev/null +++ b/17-results-summary-component-go/templates/index.gohtml @@ -0,0 +1,45 @@ + + + + + + + + + + + Frontend Mentor | Results summary component + + + + + +
+ {{ template "results-summary-component" . }} +
+ + + diff --git a/17-results-summary-component-go/templates/summary-component.gohtml b/17-results-summary-component-go/templates/summary-component.gohtml index bbb46f5..94b79ed 100644 --- a/17-results-summary-component-go/templates/summary-component.gohtml +++ b/17-results-summary-component-go/templates/summary-component.gohtml @@ -18,7 +18,7 @@ href="static/public/images/favicon-32x32.png" /> - Frontend Mentor | Results summary component + THIS IS FILE FOR THE COMPONENT