GoBlog/customPages.go

15 lines
389 B
Go
Raw Normal View History

2020-10-13 11:40:16 +00:00
package main
import "net/http"
const customPageContextKey = "custompage"
func (a *goBlog) serveCustomPage(w http.ResponseWriter, r *http.Request) {
page := r.Context().Value(customPageContextKey).(*configCustomPage)
a.render(w, r, page.Template, &renderData{
BlogString: r.Context().Value(blogKey).(string),
Canonical: a.getFullAddress(page.Path),
Data: page.Data,
})
2020-10-13 11:40:16 +00:00
}