mirror of
https://git.freesoftwareextremist.com/bloat
synced 2024-12-22 01:00:44 +00:00
Restrict instance level custom CSS to static directory
This commit is contained in:
parent
927072e26a
commit
ed521dd33d
3 changed files with 2 additions and 10 deletions
|
@ -38,5 +38,4 @@ post_formats=PlainText:text/plain,HTML:text/html,Markdown:text/markdown,BBCode:t
|
|||
# single_instance=pl.mydomain.com
|
||||
|
||||
# Path to custom CSS. Value can be a file path relative to the static directory.
|
||||
# or a URL starting with either "http://" or "https://".
|
||||
# custom_css=custom.css
|
||||
|
|
9
main.go
9
main.go
|
@ -8,7 +8,6 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"bloat/config"
|
||||
"bloat/renderer"
|
||||
|
@ -47,14 +46,8 @@ func main() {
|
|||
errExit(err)
|
||||
}
|
||||
|
||||
customCSS := config.CustomCSS
|
||||
if len(customCSS) > 0 && !strings.HasPrefix(customCSS, "http://") &&
|
||||
!strings.HasPrefix(customCSS, "https://") {
|
||||
customCSS = "/static/" + customCSS
|
||||
}
|
||||
|
||||
s := service.NewService(config.ClientName, config.ClientScope,
|
||||
config.ClientWebsite, customCSS, config.SingleInstance,
|
||||
config.ClientWebsite, config.CustomCSS, config.SingleInstance,
|
||||
config.PostFormats, renderer)
|
||||
handler := service.NewHandler(s, *verbose, config.StaticDirectory)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} </title>
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
{{if .CustomCSS}}
|
||||
<link rel="stylesheet" href="{{.CustomCSS}}">
|
||||
<link rel="stylesheet" href="/static/{{.CustomCSS}}">
|
||||
{{end}}
|
||||
{{if $.Ctx.FluorideMode}}
|
||||
<script src="/static/fluoride.js"></script>
|
||||
|
|
Loading…
Reference in a new issue