This is my new blog CMS https://jlelse.blog
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
622 B

package main
import "net/http"
const taxonomyContextKey = "taxonomy"
func serveTaxonomy(w http.ResponseWriter, r *http.Request) {
blog := r.Context().Value(blogContextKey).(string)
tax := r.Context().Value(taxonomyContextKey).(*taxonomy)
allValues, err := allTaxonomyValues(blog, tax.Name)
if err != nil {
serveError(w, r, err.Error(), http.StatusInternalServerError)
return
}
render(w, r, templateTaxonomy, &renderData{
BlogString: blog,
Canonical: appConfig.Server.PublicAddress + r.URL.Path,
Data: map[string]interface{}{
"Taxonomy": tax,
"ValueGroups": groupStrings(allValues),
},
})
}