Skip to content

Commit

Permalink
Replace whole URLs in CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
symroe committed Dec 20, 2023
1 parent 679ca6e commit b1e770e
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 213 deletions.
4 changes: 3 additions & 1 deletion lib/template_generator/generate_base_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def rewrite_css_urls(asset_text, souce_url):
cleaned_url = re.sub('"', "", url)
if cleaned_url[0] in ["/", ".."]:
absolute_url = urljoin(souce_url, cleaned_url)
asset_text = asset_text.replace(cleaned_url, absolute_url)
asset_text = asset_text.replace(
f"({cleaned_url})", f"({absolute_url})"
)
return asset_text


Expand Down
208 changes: 0 additions & 208 deletions postcode_lookup/static/css/all.9ec705e14e02dd07216df46210c0785c.css

This file was deleted.

208 changes: 208 additions & 0 deletions postcode_lookup/static/css/all.b851a2b81821e56093624f11617e53cc.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions postcode_lookup/static/css/all.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion postcode_lookup/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<meta content="/favicons/mstile-144x144.png" name="msapplication-TileImage"/>
<meta content="/favicons/browserconfig.xml" name="msapplication-config"/>
<meta content="#ffffff" name="theme-color"/>
<link href="/static/css/all.9ec705e14e02dd07216df46210c0785c.css" media="all" rel="stylesheet"/>
<link href="/static/css/all.b851a2b81821e56093624f11617e53cc.css" media="all" rel="stylesheet"/>
<link href="/static/css/print.5f9325f4fcf7f5347259a7397a1be4e8.css" media="print" rel="stylesheet"/>
{% if request.url.netloc != "www.electoralcommission.org.uk" %}
<style>
Expand Down
2 changes: 1 addition & 1 deletion postcode_lookup/templates/base_cy.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<meta content="/favicons/mstile-144x144.png" name="msapplication-TileImage"/>
<meta content="/favicons/browserconfig.xml" name="msapplication-config"/>
<meta content="#ffffff" name="theme-color"/>
<link href="/static/css/all.9ec705e14e02dd07216df46210c0785c.css" media="all" rel="stylesheet"/>
<link href="/static/css/all.b851a2b81821e56093624f11617e53cc.css" media="all" rel="stylesheet"/>
<link href="/static/css/print.5f9325f4fcf7f5347259a7397a1be4e8.css" media="print" rel="stylesheet"/>
{% if request.url.netloc != "www.electoralcommission.org.uk" %}
<style>
Expand Down

0 comments on commit b1e770e

Please sign in to comment.