Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CMD-164 custom styles via setting #840

Merged
merged 7 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion taccsite_cms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,15 @@ def gettext(s): return s
# PORTAL_SOCIAL_SHARE_PLATFORMS = ['linkedin', 'instagram', 'facebook', 'bluesky', 'email']

########################
# TACC: CORE STYLES
# TACC: STYLES
########################

PORTAL_STYLES = []
# PORTAL_STYLES = [{
# "is_remote": True,
# "path": "https://cdn.jsdelivr.net/gh/TACC/Core-CMS-Custom@2cdc59f/example_cms/src/apps/example_app/static/example_app/css/example_app.css",
# }]

# Only use integer numbers (not "v1", not "0.11.0"),
# so templates can load based on simple comparisons
TACC_CORE_STYLES_VERSION = 2
Expand Down Expand Up @@ -795,6 +801,7 @@ def get_subdirs_as_module_names(path):
'PORTAL_HAS_LOGIN',
'PORTAL_HAS_SEARCH',
'PORTAL_NAV_WIDTH',
'PORTAL_STYLES',
'PORTAL_BLOG_SHOW_CATEGORIES',
'PORTAL_BLOG_SHOW_TAGS',
'PORTAL_BLOG_CUSTOM_MEDIA_POST_CATEGORY',
Expand Down
9 changes: 9 additions & 0 deletions taccsite_cms/templates/assets_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@



<!-- Custom Site Assets: Styles. -->
{% with settings.PORTAL_STYLES as styles %}
{% for style in styles %}
<link rel="stylesheet" href="{% if style.is_remote %}{{ style.path }}{% else %}{% static style.path %}{% endif %}" />
{% endfor %}
{% endwith %}



{# Do NOT directly load project-specific assets here; see `/taccsite_custom` #}

{# Example #}
Expand Down