mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
18 lines
434 B
Go
18 lines
434 B
Go
package api
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func GetPostsPage(w http.ResponseWriter, _ *http.Request) {
|
|
posts := Container.ListPostsUseCase.ListPosts()
|
|
navbarTmpl, _ := Container.GetPageUseCase.GetPage("componentNavbar", nil)
|
|
postsTmpl, _ := Container.GetPageUseCase.GetPage("posts", map[string]interface{}{
|
|
"Navbar": template.HTML(navbarTmpl),
|
|
"Head": headTmpl,
|
|
"Posts": posts,
|
|
})
|
|
_, _ = w.Write(postsTmpl)
|
|
}
|