diff --git a/.gitignore b/.gitignore index f33ebb0..45bf28e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules *.swp *.swo +static/local/custom.css build tmp *.ini diff --git a/app.go b/app.go index 5aac3d1..c2989cb 100644 --- a/app.go +++ b/app.go @@ -356,6 +356,11 @@ func pageForReq(app *App, r *http.Request) page.StaticPage { Version: "v" + softwareVer, } + // Use custom style, if file exists + if _, err := os.Stat(filepath.Join(staticDir, "local", "custom.css")); err == nil { + p.CustomCSS = true + } + // Add user information, if given var u *User accessToken := r.FormValue("t") diff --git a/page/page.go b/page/page.go index 3112270..5ab7750 100644 --- a/page/page.go +++ b/page/page.go @@ -21,6 +21,7 @@ type StaticPage struct { config.AppCfg Version string HeaderNav bool + CustomCSS bool // Request values Path string diff --git a/templates/bare.tmpl b/templates/bare.tmpl index f76eed9..a5f9910 100644 --- a/templates/bare.tmpl +++ b/templates/bare.tmpl @@ -5,6 +5,7 @@ {{if .Editing}}Editing {{if .Post.Title}}{{.Post.Title}}{{else}}{{.Post.Id}}{{end}}{{else}}New Post{{end}} — {{.SiteName}} + {{if .CustomCSS}}{{end}} diff --git a/templates/base.tmpl b/templates/base.tmpl index 389f303..273c2b9 100644 --- a/templates/base.tmpl +++ b/templates/base.tmpl @@ -3,6 +3,7 @@ {{ template "head" . }} + {{if .CustomCSS}}{{end}} diff --git a/templates/chorus-collection-post.tmpl b/templates/chorus-collection-post.tmpl index 537e4ef..468455c 100644 --- a/templates/chorus-collection-post.tmpl +++ b/templates/chorus-collection-post.tmpl @@ -6,6 +6,7 @@ {{.PlainDisplayTitle}} {{localhtml "title dash" .Language.String}} {{.Collection.DisplayTitle}} + {{if .CustomCSS}}{{end}} diff --git a/templates/chorus-collection.tmpl b/templates/chorus-collection.tmpl index d105dff..2bc165d 100644 --- a/templates/chorus-collection.tmpl +++ b/templates/chorus-collection.tmpl @@ -6,6 +6,7 @@ {{.DisplayTitle}}{{if not .SingleUser}} — {{.SiteName}}{{end}} + {{if .CustomCSS}}{{end}} {{if gt .CurrentPage 1}}{{end}} diff --git a/templates/classic.tmpl b/templates/classic.tmpl index ecc8cb9..7032f58 100644 --- a/templates/classic.tmpl +++ b/templates/classic.tmpl @@ -6,6 +6,7 @@ + {{if .CustomCSS}}{{end}} diff --git a/templates/collection-post.tmpl b/templates/collection-post.tmpl index 5d56abd..54d5298 100644 --- a/templates/collection-post.tmpl +++ b/templates/collection-post.tmpl @@ -6,6 +6,7 @@ {{.PlainDisplayTitle}} {{localhtml "title dash" .Language.String}} {{.Collection.DisplayTitle}} + {{if .CustomCSS}}{{end}} {{ if .IsFound }} diff --git a/templates/collection-tags.tmpl b/templates/collection-tags.tmpl index e2f8962..6a989a7 100644 --- a/templates/collection-tags.tmpl +++ b/templates/collection-tags.tmpl @@ -6,6 +6,7 @@ {{.Tag}} — {{.Collection.DisplayTitle}} + {{if .CustomCSS}}{{end}} {{if not .Collection.IsPrivate}}{{end}} diff --git a/templates/collection.tmpl b/templates/collection.tmpl index 493e6b7..db0591d 100644 --- a/templates/collection.tmpl +++ b/templates/collection.tmpl @@ -6,6 +6,7 @@ {{.DisplayTitle}}{{if not .SingleUser}} — {{.SiteName}}{{end}} + {{if .CustomCSS}}{{end}} {{if gt .CurrentPage 1}}{{end}} diff --git a/templates/edit-meta.tmpl b/templates/edit-meta.tmpl index 5bfcdec..d3f93a8 100644 --- a/templates/edit-meta.tmpl +++ b/templates/edit-meta.tmpl @@ -5,6 +5,7 @@ Edit metadata: {{if .Post.Title}}{{.Post.Title}}{{else}}{{.Post.Id}}{{end}} — {{.SiteName}} + {{if .CustomCSS}}{{end}}