1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Add the ability to use custom css

This commit is contained in:
Alex McGrath 2020-03-31 00:54:02 +01:00 committed by Frédéric Guillot
parent ae8e5c4dbc
commit 7accdc4416
19 changed files with 67 additions and 12 deletions

View file

@ -16,6 +16,24 @@ import (
func (h *handler) showStylesheet(w http.ResponseWriter, r *http.Request) {
filename := request.RouteStringParam(r, "name")
if filename == "custom_css" {
user, err := h.store.UserByID(request.UserID(r))
if err != nil {
html.NotFound(w, r)
return
}
b := response.New(w, r)
if user == nil {
b.WithHeader("Content-Type", "text/css; charset=utf-8")
b.WithBody("")
b.Write()
return
}
b.WithHeader("Content-Type", "text/css; charset=utf-8")
b.WithBody(user.Extra["custom_css"])
b.Write()
return
}
etag, found := static.StylesheetsChecksums[filename]
if !found {
html.NotFound(w, r)