+type HeaderData struct {
+ SelectedMenu string
+ Username string
+}
+
+func renderHeader(w http.ResponseWriter, selectedMenu string) {
+ tmpl := template.Must(template.ParseFS(content, "templates/header.html"))
+ data := HeaderData{
+ SelectedMenu: selectedMenu,
+ Username: "username",
+ }
+ err := tmpl.Execute(w, data)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+
+func renderFooter(w http.ResponseWriter) {
+ tmpl := template.Must(template.ParseFS(content, "templates/footer.html"))
+ err := tmpl.Execute(w, nil)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+