package main import "strings" func html_Element(tag string, innerHTML string, args string) string { return "<" + tag + " " + args + ">" + innerHTML + "" + tag + ">" } func html_LinkElement(innerHTML string, destination string, blank bool, args string) string { b := "" if blank { b = "target=\"_blank\"" } return html_Element("a", innerHTML, " href=\""+destination+"\" "+b) } func html_InputElement(name string, _type string, value string, args string) string { return "" } func html_Nav(pages [][]string) string { output := "" for _, page := range pages { output += html_Element("li", html_LinkElement(page[0], page[1], false, ""), "") } return html_Element("nav", html_Element("ul", output, ""), "") } func html_replacer(input string) string { output := strings.ReplaceAll(input, "!NAV", html_Nav(getPages())) if getRoomState().state { output = strings.ReplaceAll(output, "!RAUMSTATUS", "
Raumstatus: offen
") } else { output = strings.ReplaceAll(output, "!RAUMSTATUS", "Raumstatus: geschlossen
") } output = strings.ReplaceAll(output, "!FOOTERNAV", html_Nav(getFooterPages())) return output }