Skip to content

Commit

Permalink
feat(texascale): load annual stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jun 30, 2022
1 parent a87ede7 commit 32c3485
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions texascale-org/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load staticfiles get_url_match %}

{% block assets_custom %}
{{ block.super }}

{% with year_slug=request.path|get_url_match:"/(2019|202\d)/" %}
{% if year_slug %}
{% with src="texascale-org/css/build/site."|add:year_slug|add:".css" %}
<link rel="stylesheet" href="{% static src %}" data-year_slug="{{year_slug}}">
{% endwith %}
{% else %}
{% if settings.DEBUG %}
<!-- will not load annual CSS cuz year_slug is {{year_slug}} not 2019…2029 -->
{% endif %}
{% endif %}
{% endwith %}
{% endblock assets_custom %}
2 changes: 1 addition & 1 deletion texascale-org/templates/fullwidth.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "./base.html" %}
{% load cms_tags staticfiles %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}
Expand Down

0 comments on commit 32c3485

Please sign in to comment.