mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 10:12:11 +00:00
[bugfix] Load instance-wide custom css in page stylesheets template (#3601)
* [bugfix] Load instance-wide custom css in page stylesheets template * [chore] remove redunt import
This commit is contained in:
parent
eb77ceeed6
commit
f78002f915
|
@ -54,7 +54,7 @@ func (m *Module) aboutGETHandler(c *gin.Context) {
|
|||
Template: "about.tmpl",
|
||||
Instance: instance,
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Stylesheets: []string{cssAbout, instanceCustomCSSPath},
|
||||
Stylesheets: []string{cssAbout},
|
||||
Extra: map[string]any{
|
||||
"showStrap": true,
|
||||
"blocklistExposed": config.GetInstanceExposeSuspendedWeb(),
|
||||
|
|
|
@ -127,9 +127,8 @@ func (m *Module) confirmEmailPOSTHandler(c *gin.Context) {
|
|||
// Serve page informing user that their
|
||||
// email address is now confirmed.
|
||||
page := apiutil.WebPage{
|
||||
Template: "confirmed_email.tmpl",
|
||||
Instance: instance,
|
||||
Stylesheets: []string{instanceCustomCSSPath},
|
||||
Template: "confirmed_email.tmpl",
|
||||
Instance: instance,
|
||||
Extra: map[string]any{
|
||||
"email": user.Email,
|
||||
"username": user.Account.Username,
|
||||
|
|
|
@ -67,7 +67,7 @@ func (m *Module) domainBlockListGETHandler(c *gin.Context) {
|
|||
Template: "domain-blocklist.tmpl",
|
||||
Instance: instance,
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Stylesheets: []string{cssFA, instanceCustomCSSPath},
|
||||
Stylesheets: []string{cssFA},
|
||||
Javascript: []string{jsFrontend},
|
||||
Extra: map[string]any{"blocklist": domainBlocks},
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ func (m *Module) indexHandler(c *gin.Context) {
|
|||
Template: "index.tmpl",
|
||||
Instance: instance,
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Stylesheets: []string{cssAbout, cssIndex, instanceCustomCSSPath},
|
||||
Stylesheets: []string{cssAbout, cssIndex},
|
||||
Extra: map[string]any{"showStrap": true},
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,6 @@ func (m *Module) profileGETHandler(c *gin.Context) {
|
|||
cssStatus,
|
||||
cssThread,
|
||||
cssProfile,
|
||||
instanceCustomCSSPath,
|
||||
}...,
|
||||
)
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ func (m *Module) SettingsPanelHandler(c *gin.Context) {
|
|||
cssProfile, // Used for rendering stub/fake profiles.
|
||||
cssStatus, // Used for rendering stub/fake statuses.
|
||||
cssSettings,
|
||||
instanceCustomCSSPath,
|
||||
},
|
||||
Javascript: []string{jsSettings},
|
||||
}
|
||||
|
|
|
@ -126,10 +126,9 @@ func (m *Module) signupPOSTHandler(c *gin.Context) {
|
|||
// Serve a page informing the
|
||||
// user that they've signed up.
|
||||
page := apiutil.WebPage{
|
||||
Template: "signed-up.tmpl",
|
||||
Instance: instance,
|
||||
Stylesheets: []string{instanceCustomCSSPath},
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Template: "signed-up.tmpl",
|
||||
Instance: instance,
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Extra: map[string]any{
|
||||
"email": user.UnconfirmedEmail,
|
||||
"username": user.Account.Username,
|
||||
|
|
|
@ -59,7 +59,7 @@ func (m *Module) tagGETHandler(c *gin.Context) {
|
|||
Template: "tag.tmpl",
|
||||
Instance: instance,
|
||||
OGMeta: apiutil.OGBase(instance),
|
||||
Stylesheets: []string{cssFA, cssThread, cssTag, instanceCustomCSSPath},
|
||||
Stylesheets: []string{cssFA, cssThread, cssTag},
|
||||
Extra: map[string]any{"tagName": tagName},
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,6 @@ func (m *Module) threadGETHandler(c *gin.Context) {
|
|||
cssFA,
|
||||
cssStatus,
|
||||
cssThread,
|
||||
instanceCustomCSSPath,
|
||||
}...,
|
||||
)
|
||||
|
||||
|
|
|
@ -32,10 +32,16 @@
|
|||
{{- range .stylesheets }}
|
||||
<link rel="preload" href="{{- . -}}" as="style">
|
||||
{{- end }}
|
||||
{{- if .instance.CustomCSS }}
|
||||
<link rel="preload" href="/custom.css" as="style">
|
||||
{{- end }}
|
||||
<link rel="stylesheet" href="/assets/dist/_colors.css">
|
||||
<link rel="stylesheet" href="/assets/dist/base.css">
|
||||
<link rel="stylesheet" href="/assets/dist/page.css">
|
||||
{{- range .stylesheets }}
|
||||
<link rel="stylesheet" href="{{- . -}}">
|
||||
{{- end }}
|
||||
{{- if .instance.CustomCSS }}
|
||||
<link rel="stylesheet" href="/custom.css">
|
||||
{{- end }}
|
||||
{{- end }}
|
Loading…
Reference in a new issue