1
0

Call Index template right in-place.

This commit is contained in:
Alexander Andreev 2024-06-19 01:06:33 +04:00
parent 52439ee836
commit 77aa7a5e63
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
2 changed files with 2 additions and 5 deletions

View File

@ -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)

View File

@ -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",