Add comments about isRaw logic
This commit is contained in:
parent
60a6848361
commit
bd180f56a8
6
posts.go
6
posts.go
|
@ -266,6 +266,8 @@ func handleViewPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
|||
vars := mux.Vars(r)
|
||||
friendlyID := vars["post"]
|
||||
|
||||
// NOTE: until this is done better, be sure to keep this in parity with
|
||||
// isRaw() and viewCollectionPost()
|
||||
isJSON := strings.HasSuffix(friendlyID, ".json")
|
||||
isXML := strings.HasSuffix(friendlyID, ".xml")
|
||||
isCSS := strings.HasSuffix(friendlyID, ".css")
|
||||
|
@ -1197,6 +1199,8 @@ func isRaw(r *http.Request) bool {
|
|||
vars := mux.Vars(r)
|
||||
slug := vars["slug"]
|
||||
|
||||
// NOTE: until this is done better, be sure to keep this in parity with
|
||||
// isRaw in viewCollectionPost() and handleViewPost()
|
||||
isJSON := strings.HasSuffix(slug, ".json")
|
||||
isXML := strings.HasSuffix(slug, ".xml")
|
||||
isMarkdown := strings.HasSuffix(slug, ".md")
|
||||
|
@ -1207,6 +1211,8 @@ func viewCollectionPost(app *App, w http.ResponseWriter, r *http.Request) error
|
|||
vars := mux.Vars(r)
|
||||
slug := vars["slug"]
|
||||
|
||||
// NOTE: until this is done better, be sure to keep this in parity with
|
||||
// isRaw() and handleViewPost()
|
||||
isJSON := strings.HasSuffix(slug, ".json")
|
||||
isXML := strings.HasSuffix(slug, ".xml")
|
||||
isMarkdown := strings.HasSuffix(slug, ".md")
|
||||
|
|
Loading…
Reference in New Issue