From cf37bb28c3a6177f65ffc5de7fa7df90a65fdf48 Mon Sep 17 00:00:00 2001 From: PCloud Date: Thu, 16 May 2024 18:48:30 +0100 Subject: [PATCH 1/3] feat: initial support for speculationrules --- assets/css/main.css | 8 ++++++-- layouts/_default/baseof.html | 16 +++++++++++++++- layouts/partials/assets.html | 9 ++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index ffdd9206f..cf6ea7722 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -639,7 +639,9 @@ html.dark { --friend-link-color: var(--fgColor-link); --friend-link-hover-color: var(--fgColor-link-hover); --sponsor-button-background-color: var(--button-default-bgColor-rest); - --sponsor-button-hover-background-color: var(--button-default-bgColor-hover); + --sponsor-button-hover-background-color: var( + --button-default-bgColor-hover + ); --cookie-background-color: white; --code-color: #e5bf78; --code-background-color: #1b2029; @@ -648,7 +650,9 @@ html.dark { /* TODO */ --code-background-color-darken-6: #1a1d23; /* TODO */ - --code-background-color-code-header: var(--code-background-color-darken-6); + --code-background-color-code-header: var( + --code-background-color-darken-6 + ); /* TODO */ --code-background-color-code-hl: #1c2025; /* TODO */ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 46bd35a59..a4d9ef40b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -24,7 +24,7 @@ {{- partial "head/seo.html" . -}} - + {{- /* Check theme isDark before body rendering */ -}} {{- $theme := .Site.Params.defaulttheme -}} + diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index e63509ff1..84f24f9a7 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -288,7 +288,14 @@ {{/* Instant page */}} {{- if $params.instantpage.enable -}} {{- $js := resources.Get "/lib/instant.page/instantpage.min.js" -}} - + {{- end -}} {{- range (.Scratch.Get "this").style -}} From b1add93552c1ca671a5cff88d6bfc5a5fa51718c Mon Sep 17 00:00:00 2001 From: PCloud Date: Thu, 16 May 2024 18:50:45 +0100 Subject: [PATCH 2/3] chore: add documentation --- layouts/_default/baseof.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a4d9ef40b..2bb64a349 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -24,6 +24,12 @@ {{- partial "head/seo.html" . -}} +{{/* + data-instant-intensity: + https://instant.page/intensity + By default, instant.page preloads 65 ms after hovering a link and when a mobile user starts touching their display. There are other options. + Preloading links as soon as they’re visible. On small mobile devices (such as smartphones) if you want your pages to be instant in more situations you can preload links as soon as they’re visible. +*/}} {{- /* Check theme isDark before body rendering */ -}} {{- $theme := .Site.Params.defaulttheme -}} From 0c162c0eaf6efdb7bd083d5997554b98249a1dd1 Mon Sep 17 00:00:00 2001 From: PCloud Date: Thu, 16 May 2024 18:54:34 +0100 Subject: [PATCH 3/3] chore: decrease the eagerness --- layouts/_default/baseof.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 2bb64a349..75197ba91 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -106,7 +106,7 @@ "prerender": [ { "where": { "href_matches": "/*" }, - "eagerness": "immediate" + "eagerness": "moderate" } ] }