filePath returns the filepath of the requested file.
(p string)
| 236 | |
| 237 | // filePath returns the filepath of the requested file. |
| 238 | func filePath(p string) string { |
| 239 | if !strings.HasPrefix(p, "/") { |
| 240 | p = "/" + p |
| 241 | } |
| 242 | return strings.TrimPrefix(path.Clean(p), "/") |
| 243 | } |
| 244 | |
| 245 | func (h *Handler) exists(filePath string) bool { |
| 246 | f, err := h.opts.SiteFS.Open(filePath) |