Skip to content

Commit

Permalink
HDX-9070 - Discovery - Google Search Console - Core Web Vitals - Prep…
Browse files Browse the repository at this point in the history
…are for March 2024

         - remove "empty.css" from webassets
         - remove lazy loading from carousel as now there are few items and is the largest section impacting the "Largest Contentful Paint", so we want the browser to prioritize loading the images
         - removed signup + verify popups from page template as they have been moved to a separate page
         - use <link rel="preconnect" to trigger DNS request for google fonts
         - refactored google recaptcha js to load only in pages where it is needed (large asset)
         - remove individual css file generation for: banner-styles, search-styles, onboarding-styles, onboarding-verify-styles, onboarding-survey-styles,
         - onboarding-styles included in onboarding-bulk-anon or onboarding-bulk-user (2 new css files)
  • Loading branch information
aalecs committed Jun 8, 2024
1 parent a4837b8 commit aaefadd
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 68 deletions.
Empty file.
159 changes: 102 additions & 57 deletions ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="sub-item">
<div class="sub-item-image">
<img class="graphic lazyload" data-src="{{ item.graphic }}" alt="Highlight item">
<img class="graphic" src="{{ item.graphic }}" alt="Highlight item">
<div class="sub-item-action">
{% if item.embed %}
<a href="{{ item.url }}" class="btn" target="_blank" data-module="hdx_click_stopper"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
{% asset 'hdx_theme/hdx-form-validator' %}
{% asset 'hdx_theme/hdx-onboarding-scripts' %}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
{% endblock %}

{% set CONST = h.HDX_CONST('UI_CONSTANTS')['ONBOARDING']['USER_INFO'] %}
Expand Down
7 changes: 4 additions & 3 deletions ckanext-hdx_theme/ckanext/hdx_theme/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
{% else %}
{{ h.snippet('widget/onboarding/logout.html', id="logoutPopup")}}
{# {{ h.snippet('widget/onboarding/login.html', id="loginPopup", login_came_from=data.login_came_from if data else None) }}#}
{{ h.snippet('widget/onboarding/signup.html', id="signupPopup") }}
{{ h.snippet('widget/onboarding/verify.html', id="verifyPopup") }}
{# {{ h.snippet('widget/onboarding/signup.html', id="signupPopup") }}
{{ h.snippet('widget/onboarding/verify.html', id="verifyPopup") }} #}
{% endif %}
{{ h.snippet('widget/onboarding/survey.html', id="surveyPopup") }}

Expand Down Expand Up @@ -223,7 +223,8 @@
{# {% if g.tracking_enabled %}#}
{# {% resource 'hdx_theme/package/tracking.js' %}#}
{# {% endif %}#}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel=preconnect href="https://fonts.gstatic.com" />
{#<script src="https://www.google.com/recaptcha/api.js" async defer></script>#}
{{ super() }}
{% asset 'hdx_theme/search-scripts' %}
{% if c.userobj %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
{# {% if g.tracking_enabled %}#}
{# {% resource 'hdx_theme/package/tracking.js' %}#}
{# {% endif %}#}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel=preconnect href="https://fonts.gstatic.com" />
{#<script src="https://www.google.com/recaptcha/api.js" async defer></script>#}
{{ super() }}
{% if c.userobj %}
{% set data = h.get_user_extra(c.userobj.id) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{% block styles %}
{{ super() }}
{% asset 'hdx_theme/page-styles' %}
{% asset 'hdx_theme/onboarding-styles' %}
{% asset 'requestdata/main-styles' %}
{% asset 'hdx_theme/onboarding-password-styles' %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
{% block styles %}
{{ super() }}
{% asset 'hdx_theme/page-styles' %}
{% asset 'hdx_theme/onboarding-styles' %}
{% asset 'hdx_theme/onboarding-password-styles' %}
{% asset 'hdx_theme/signin-styles' %}
{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{{ h.snippet('widget/onboarding/done.html', id="donePopup") }}
#}
{#{% resource 'hdx_theme/widget/onboarding/survey.css' %}#}
{% asset 'hdx_theme/onboarding-survey-styles' %}

{% set class = "popup-onbording" %}
{% set title = "HDX Data Use Survey" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
Example:
{{ h.snippet('widget/onboarding/done.html', id="donePopup") }}
#}
{#{% resource 'hdx_theme/widget/onboarding/survey.css' %}#}
{% asset 'hdx_theme/onboarding-survey-styles' %}

{% set class = "popup-onbording" %}
{% set title = "Data Literacy Survey" %}
Expand Down

0 comments on commit aaefadd

Please sign in to comment.