domain/content/publisher/mux.go (view raw)
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 | package publisher
import (
"net/http"
pubtpl "alin.ovh/homestead/domain/content/publisher/templates"
"alin.ovh/homestead/domain/web/templates"
ihttp "alin.ovh/homestead/shared/http"
)
func (app *App) Index(w http.ResponseWriter, _ *http.Request) ihttp.Error {
err := pubtpl.IndexPage(app.siteSettings, templates.PageSettings{
Title: "Home",
}).Render(w)
if err != nil {
return ihttp.InternalServerError("Failed to render index page", err)
}
return nil
}
func (app *App) Style(w http.ResponseWriter, r *http.Request) ihttp.Error {
w.Header().Set("Content-Type", "text/css")
http.ServeFileFS(w, r, templates.Files, "style.css")
return nil
}
|