Skip to content

Commit

Permalink
πŸ› fix: resolve preload request credentials mismatch
Browse files Browse the repository at this point in the history
The DevTools console displayed an error for a preload request for 'logo-plainSVG.svg'. The preload was not used because the request credentials mode did not match the expected 'crossorigin' attribute settings.

Fixes #60
  • Loading branch information
chriskyfung committed Mar 21, 2024
1 parent 752ab82 commit 20b5154
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@
<link rel="icon" href="{{ site.favicon | relative_url }}">
<link rel="preconnect dns-prefetch" href="https://www.googletagmanager.com" crossorigin>
<link rel="preconnect dns-prefetch" href="https://fonts.gstatic.com/" crossorigin>
<link rel="preload" href="{{ site.logo | relative_url }}" as="image" crossorigin>
<link rel="preload" href="{{ site.logo | relative_url }}" as="image">
<link rel="preload" href="https://use.fontawesome.com/releases/v5.13.1/webfonts/fa-brands-400.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="https://use.fontawesome.com/releases/v5.13.1/webfonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="https://use.fontawesome.com/releases/v5.13.1/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.1/css/all.css" crossorigin>
{%- if site.adsense.client_id and site.adstyle != false -%}
<link rel="preload" href="https://chriskyfung.github.io/amp-affiliately-jekyll-theme/assets/images/b8d82a619c.png" as="image" crossorigin>
<link rel="preload" href="https://chriskyfung.github.io/amp-affiliately-jekyll-theme/assets/images/b8d82a619c.png" as="image">
{%- endif -%}
{%- if page.image.path -%}
{%- assign img_ext = page.image.path | split: "." | last -%}
{%- if img_ext == "svg" -%}
<link rel="preload" href="{{ page.image.path | relative_url }}" as="image" crossorigin>
<link rel="preload" href="{{ page.image.path | relative_url }}" as="image">
{%- else -%}
{%- assign webp_img = page.image.path | remove: img_ext | append: "webp" -%}
<link rel="preload" href="{{ webp_img | relative_url }}" as="image" type="image/webp" crossorigin>
<link rel="preload" href="{{ webp_img | relative_url }}" as="image" type="image/webp">
{%- endif -%}
{%- endif -%}

Expand Down

0 comments on commit 20b5154

Please sign in to comment.