mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
feat: allow portal logo override (#1391)
This commit is contained in:
parent
c4c5ecf06a
commit
1c1af489f1
@ -105,6 +105,16 @@ USE_L10N = True
|
|||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
|
||||||
|
# these are the logos by default. SVG gets a priority
|
||||||
|
# which means it will be used if available
|
||||||
|
# if you want to override them, set the new paths here
|
||||||
|
# and place the files on the static/images folder
|
||||||
|
PORTAL_LOGO_DARK_SVG = "/static/images/logo_dark.svg"
|
||||||
|
PORTAL_LOGO_DARK_PNG = "/static/images/logo_dark.png"
|
||||||
|
PORTAL_LOGO_LIGHT_SVG = "/static/images/logo_light.svg"
|
||||||
|
PORTAL_LOGO_LIGHT_PNG = "/static/images/logo_dark.png"
|
||||||
|
|
||||||
|
|
||||||
# protection agains anonymous users
|
# protection agains anonymous users
|
||||||
# per ip address limit, for actions as like/dislike/report
|
# per ip address limit, for actions as like/dislike/report
|
||||||
TIME_TO_ACTION_ANONYMOUS = 10 * 60
|
TIME_TO_ACTION_ANONYMOUS = 10 * 60
|
||||||
|
|||||||
@ -240,7 +240,12 @@ Docker Compose installation: edit `deploy/docker/local_settings.py`, make a chan
|
|||||||
|
|
||||||
### 5.1 Change portal logo
|
### 5.1 Change portal logo
|
||||||
|
|
||||||
Set a new svg file for the white theme (`static/images/logo_dark.svg`) or the dark theme (`static/images/logo_light.svg`)
|
Find the default svg files for the white theme on `static/images/logo_dark.svg` and for the dark theme on `static/images/logo_light.svg`
|
||||||
|
You can specify new svg paths to override by editing the `PORTAL_LOGO_DARK_SVG` and `PORTAL_LOGO_LIGHT_SVG` variables in `settings.py`.
|
||||||
|
|
||||||
|
You can also use custom pngs, by setting the variables `PORTAL_LOGO_DARK_PNG` and `PORTAL_LOGO_LIGHT_PNG` in `settings.py`. The svg files have priority over png files, so if both are set, svg files will be used.
|
||||||
|
|
||||||
|
In any case, make sure the files are placed on the static/images folder.
|
||||||
|
|
||||||
### 5.2 Set global portal title
|
### 5.2 Set global portal title
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,12 @@ def stuff(request):
|
|||||||
ret["FRONTEND_HOST"] = request.build_absolute_uri('/').rstrip('/')
|
ret["FRONTEND_HOST"] = request.build_absolute_uri('/').rstrip('/')
|
||||||
ret["DEFAULT_THEME"] = settings.DEFAULT_THEME
|
ret["DEFAULT_THEME"] = settings.DEFAULT_THEME
|
||||||
ret["PORTAL_NAME"] = settings.PORTAL_NAME
|
ret["PORTAL_NAME"] = settings.PORTAL_NAME
|
||||||
|
|
||||||
|
ret["PORTAL_LOGO_DARK_SVG"] = settings.PORTAL_LOGO_DARK_SVG
|
||||||
|
ret["PORTAL_LOGO_DARK_PNG"] = settings.PORTAL_LOGO_DARK_PNG
|
||||||
|
ret["PORTAL_LOGO_LIGHT_SVG"] = settings.PORTAL_LOGO_LIGHT_SVG
|
||||||
|
ret["PORTAL_LOGO_LIGHT_PNG"] = settings.PORTAL_LOGO_LIGHT_PNG
|
||||||
|
|
||||||
ret["PORTAL_DESCRIPTION"] = settings.PORTAL_DESCRIPTION
|
ret["PORTAL_DESCRIPTION"] = settings.PORTAL_DESCRIPTION
|
||||||
ret["LOAD_FROM_CDN"] = settings.LOAD_FROM_CDN
|
ret["LOAD_FROM_CDN"] = settings.LOAD_FROM_CDN
|
||||||
ret["CAN_LOGIN"] = settings.LOGIN_ALLOWED
|
ret["CAN_LOGIN"] = settings.LOGIN_ALLOWED
|
||||||
|
|||||||
@ -4,19 +4,19 @@ MediaCMS.site = {
|
|||||||
url: '{{FRONTEND_HOST}}',
|
url: '{{FRONTEND_HOST}}',
|
||||||
api: '{{FRONTEND_HOST}}/api/v1',
|
api: '{{FRONTEND_HOST}}/api/v1',
|
||||||
theme: {
|
theme: {
|
||||||
mode: '{{DEFAULT_THEME}}',
|
mode: '{{DEFAULT_THEME}}',
|
||||||
switch: {
|
switch: {
|
||||||
position: 'sidebar', // Valid values: 'header', 'sidebar'.
|
position: 'sidebar', // Valid values: 'header', 'sidebar'.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
logo:{
|
logo:{
|
||||||
lightMode:{
|
lightMode:{
|
||||||
img: "/static/images/logo_dark.png",
|
img: "{{PORTAL_LOGO_DARK_PNG}}",
|
||||||
svg: "/static/images/logo_dark.svg",
|
svg: "{{PORTAL_LOGO_DARK_SVG}}",
|
||||||
},
|
},
|
||||||
darkMode:{
|
darkMode:{
|
||||||
img: "/static/images/logo_light.png",
|
img: "{{PORTAL_LOGO_LIGHT_PNG}}",
|
||||||
svg: "/static/images/logo_light.svg",
|
svg: "{{PORTAL_LOGO_LIGHT_SVG}}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user