2020-10-13 11:40:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
2021-03-22 07:20:56 +00:00
|
|
|
const customPageContextKey = "custompage"
|
|
|
|
|
2021-06-06 12:39:42 +00:00
|
|
|
func (a *goBlog) serveCustomPage(w http.ResponseWriter, r *http.Request) {
|
2021-07-12 14:19:28 +00:00
|
|
|
page := r.Context().Value(customPageContextKey).(*configCustomPage)
|
2021-06-06 12:39:42 +00:00
|
|
|
a.render(w, r, page.Template, &renderData{
|
2021-07-27 10:51:08 +00:00
|
|
|
BlogString: r.Context().Value(blogKey).(string),
|
2021-06-10 20:09:50 +00:00
|
|
|
Canonical: a.getFullAddress(page.Path),
|
2021-03-22 07:20:56 +00:00
|
|
|
Data: page.Data,
|
|
|
|
})
|
2020-10-13 11:40:16 +00:00
|
|
|
}
|