Compare commits

...

5 Commits

Author SHA1 Message Date
BBaoVanC 9ca15a198f
Revert "Load bobastyle.css async too"
This reverts commits f33492ef8e and 5c87c2b069.

It turns out this makes performance score even worse because it makes
the CLS really bad
2023-11-05 01:20:20 -05:00
BBaoVanC 5c87c2b069
Fix async loading of bobastyle.css 2023-11-05 01:00:22 -05:00
BBaoVanC 6c42ae9518
Lazy load images 2023-11-05 00:56:13 -05:00
BBaoVanC f33492ef8e
Load bobastyle.css async too 2023-11-05 00:56:01 -05:00
BBaoVanC ffcae79156
Load syntax CSS async 2023-11-05 00:31:26 -05:00
3 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@
{{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
{{ else if eq .MediaType.MainType "video" }}
<video controls preload="metadata">
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">

View File

@ -7,10 +7,10 @@
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ with resources.Get "css/syntax.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
{{ end }}
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
{{ end }}
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}

View File

@ -10,7 +10,7 @@
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" />
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
{{ else if eq $type "video" }}
<video controls preload="metadata">
<source src="{{ $src }}" alt="{{ $alt }}">