1
mirror of https://github.com/jlelse/GoBlog synced 2024-06-02 17:54:27 +00:00
GoBlog/customPages.go

14 lines
336 B
Go

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{
Canonical: a.getFullAddress(page.Path),
Data: page.Data,
})
}