mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
feat: pass extra css (#1392)
This commit is contained in:
parent
1c1af489f1
commit
553a25a86f
@ -105,16 +105,23 @@ 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
|
# these are the portal logos (dark and light)
|
||||||
# which means it will be used if available
|
# set new paths for svg or png if you want to override
|
||||||
# if you want to override them, set the new paths here
|
# svg has priority over png, so if you want to use
|
||||||
# and place the files on the static/images folder
|
# custom pngs and not svgs, remove the lines with svgs
|
||||||
|
# or set as empty strings
|
||||||
|
# example:
|
||||||
|
# PORTAL_LOGO_DARK_SVG = ""
|
||||||
|
# PORTAL_LOGO_LIGHT_SVG = ""
|
||||||
|
# place the files on static/images folder
|
||||||
PORTAL_LOGO_DARK_SVG = "/static/images/logo_dark.svg"
|
PORTAL_LOGO_DARK_SVG = "/static/images/logo_dark.svg"
|
||||||
PORTAL_LOGO_DARK_PNG = "/static/images/logo_dark.png"
|
PORTAL_LOGO_DARK_PNG = "/static/images/logo_dark.png"
|
||||||
PORTAL_LOGO_LIGHT_SVG = "/static/images/logo_light.svg"
|
PORTAL_LOGO_LIGHT_SVG = "/static/images/logo_light.svg"
|
||||||
PORTAL_LOGO_LIGHT_PNG = "/static/images/logo_dark.png"
|
PORTAL_LOGO_LIGHT_PNG = "/static/images/logo_dark.png"
|
||||||
|
|
||||||
|
# paths to extra css files to be included, eg "/static/css/custom.css"
|
||||||
|
# place css inside static/css folder
|
||||||
|
EXTRA_CSS_PATHS = []
|
||||||
# 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
|
||||||
|
|||||||
@ -13,11 +13,11 @@ def stuff(request):
|
|||||||
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_SVG"] = getattr(settings, 'PORTAL_LOGO_DARK_SVG', "")
|
||||||
ret["PORTAL_LOGO_DARK_PNG"] = settings.PORTAL_LOGO_DARK_PNG
|
ret["PORTAL_LOGO_DARK_PNG"] = getattr(settings, 'PORTAL_LOGO_DARK_PNG', "")
|
||||||
ret["PORTAL_LOGO_LIGHT_SVG"] = settings.PORTAL_LOGO_LIGHT_SVG
|
ret["PORTAL_LOGO_LIGHT_SVG"] = getattr(settings, 'PORTAL_LOGO_LIGHT_SVG', "")
|
||||||
ret["PORTAL_LOGO_LIGHT_PNG"] = settings.PORTAL_LOGO_LIGHT_PNG
|
ret["PORTAL_LOGO_LIGHT_PNG"] = getattr(settings, 'PORTAL_LOGO_LIGHT_PNG', "")
|
||||||
|
ret["EXTRA_CSS_PATHS"] = getattr(settings, 'EXTRA_CSS_PATHS', [])
|
||||||
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
|
||||||
|
|||||||
@ -28,4 +28,9 @@
|
|||||||
<link href="{% static "css/_extra.css" %}?v={{ VERSION }}" rel="preload" as="style">
|
<link href="{% static "css/_extra.css" %}?v={{ VERSION }}" rel="preload" as="style">
|
||||||
<link href="{% static "css/_extra.css" %}?v={{ VERSION }}" rel="stylesheet">
|
<link href="{% static "css/_extra.css" %}?v={{ VERSION }}" rel="stylesheet">
|
||||||
|
|
||||||
|
{% for css_path in EXTRA_CSS_PATHS %}
|
||||||
|
<link href="{{ css_path }}?v={{ VERSION }}" rel="preload" as="style">
|
||||||
|
<link href="{{ css_path }}?v={{ VERSION }}" rel="stylesheet">
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
<link href="{% static "js/_commons.js" %}?v={{ VERSION }}" rel="preload" as="script">
|
<link href="{% static "js/_commons.js" %}?v={{ VERSION }}" rel="preload" as="script">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user