-
Notifications
You must be signed in to change notification settings - Fork 0
/
static.go
39 lines (36 loc) · 937 Bytes
/
static.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package controllers
import (
"html/template"
"net/http"
)
func StaticHandler(tpl Template) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
tpl.Execute(w, r, nil)
}
}
func FAQ(tpl Template) http.HandlerFunc {
questions := []struct {
Question string
Answer template.HTML
}{
{
Question: "Is there a free version?",
Answer: "Yes! We offer a free trial for 30 days on any paid plans.",
},
{
Question: "What are your support hours?",
Answer: "We have support staff answering emails 24/7, though response times may be a bit slower on weekends.",
},
{
Question: "How do I contact support?",
Answer: `Email us - <a href="mailto:support@lenslocked.com">support@lenslocked.com</a>`,
},
{
Question: "Where is your office?",
Answer: "Our entire team is remote!",
},
}
return func(w http.ResponseWriter, r *http.Request) {
tpl.Execute(w, r, questions)
}
}