mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
This commit introduces a refactoring in various page templates to use a central, common 'head' section, stored under utilsHead.html. This head section contains common metadata, styles, and scripts. This change enhances code reusability and standardizes the head section across different pages for consistent user experience and ease of future potential changes. Also, some minimal adjustments were made in the navigation and link routing for more user-friendly URL paths. Lastly, the server's listening interface was updated to only listen on the localhost.
16 lines
372 B
Go
16 lines
372 B
Go
package api
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func GetPostEditPage(w http.ResponseWriter, _ *http.Request) {
|
|
navbarTmpl, _ := Container.GetPageUseCase.GetPage("componentNavbar", nil)
|
|
postsTmpl, _ := Container.GetPageUseCase.GetPage("postEdit", map[string]interface{}{
|
|
"Navbar": template.HTML(navbarTmpl),
|
|
"Head": headTmpl,
|
|
})
|
|
_, _ = w.Write(postsTmpl)
|
|
}
|