File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ def large_static(file_path: str):
1414 """
1515 # Strip any leading slashes to avoid footguns
1616 file_path = file_path .lstrip ("/" )
17+
18+ # Strip any trailing slashes to avoid assumptions
19+ static_url = settings .STATIC_URL .rstrip ("/" )
20+ static_aws_endpoint = settings .STATIC_CONTENT_AWS_S3_ENDPOINT_URL .rstrip ("/" )
21+
1722 if settings .LOCAL_DEVELOPMENT :
18- return f"{ settings . STATIC_URL } static-large/{ file_path } "
23+ return f"{ static_url } / static-large/{ file_path } "
1924 else :
20- return f"{ settings . STATIC_CONTENT_AWS_S3_ENDPOINT_URL } /{ settings .STATIC_CONTENT_BUCKET_NAME } /static/{ file_path } "
25+ return f"{ static_aws_endpoint } /{ settings .STATIC_CONTENT_BUCKET_NAME } /static/{ file_path } "
Original file line number Diff line number Diff line change 1+ {% load custom_static %}
12{% comment %}
23 V3 Component Demo Page
34 ======================
@@ -722,12 +723,10 @@ <h3>{{ section_title }}</h3>
722723 {% endwith %}
723724
724725 {% with section_title="Image Handling Example" %}
725- {% load custom_static %}
726726 < div class ="v3-examples-section__block " id ="{{ section_title|slugify }} ">
727727 < h3 > {{ section_title }}</ h3 >
728728 < div class ="v3-examples-section__example-box ">
729- {% large_static '/img/v3/learn-page/Learn_Octopus.png' as img_url %}
730- < img src ="{{img_url}} " />
729+ < img src ="{% large_static 'img/v3/learn-page/Learn_Octopus.png' %} " alt ="Large Media Example " />
731730 </ div >
732731 </ div >
733732 {% endwith %}
You can’t perform that action at this time.
0 commit comments