Call Index template right in-place.
This commit is contained in:
parent
52439ee836
commit
77aa7a5e63
@ -16,6 +16,7 @@ import (
|
|||||||
"git.arav.su/Arav/dwelling-home/web"
|
"git.arav.su/Arav/dwelling-home/web"
|
||||||
"git.arav.su/Arav/httpr"
|
"git.arav.su/Arav/httpr"
|
||||||
gb "git.arav.su/Arav/justguestbook"
|
gb "git.arav.su/Arav/justguestbook"
|
||||||
|
"github.com/a-h/templ"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version string
|
var version string
|
||||||
@ -65,7 +66,7 @@ func main() {
|
|||||||
r.Handler(http.MethodGet, "/rss.xml", hand.RSS)
|
r.Handler(http.MethodGet, "/rss.xml", hand.RSS)
|
||||||
r.Handler(http.MethodGet, "/sitemap.xml", dwhttp.ServeAsset("sitemap.xml"))
|
r.Handler(http.MethodGet, "/sitemap.xml", dwhttp.ServeAsset("sitemap.xml"))
|
||||||
|
|
||||||
r.Handler(http.MethodGet, "/", hand.Index)
|
r.Handler(http.MethodGet, "/", templ.Handler(web.Index()).ServeHTTP)
|
||||||
r.Handler(http.MethodGet, "/privacy", hand.Privacy)
|
r.Handler(http.MethodGet, "/privacy", hand.Privacy)
|
||||||
r.Handler(http.MethodGet, "/stuff", hand.Stuff)
|
r.Handler(http.MethodGet, "/stuff", hand.Stuff)
|
||||||
r.Handler(http.MethodGet, "/stuff/article/*filepath", hand.Article)
|
r.Handler(http.MethodGet, "/stuff/article/*filepath", hand.Article)
|
||||||
|
@ -36,10 +36,6 @@ func NewHandlers(captchaExpire time.Duration, owner string, gbPageSize int64,
|
|||||||
guestbookPageSize: gbPageSize}
|
guestbookPageSize: gbPageSize}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) {
|
|
||||||
web.Index().Render(context.Background(), w)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h *Handlers) Privacy(w http.ResponseWriter, r *http.Request) {
|
func (h *Handlers) Privacy(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
web.Privacy("/ Privacy statements",
|
web.Privacy("/ Privacy statements",
|
||||||
|
Loading…
Reference in New Issue
Block a user