From a3cfcee2154e0608bb7f5e5d13fcfdf11d342cde Mon Sep 17 00:00:00 2001 From: RayBB Date: Sun, 26 May 2024 21:31:06 +0200 Subject: [PATCH 1/8] load carousel early for home page --- static/css/components/home.less | 1 + 1 file changed, 1 insertion(+) diff --git a/static/css/components/home.less b/static/css/components/home.less index e87238c49ca..90c08caa3ef 100644 --- a/static/css/components/home.less +++ b/static/css/components/home.less @@ -1,5 +1,6 @@ /* Homepage about section */ @import (less) "less/font-families.less"; +@import (less) "components/carousel--js.less"; div.tutorial__item { background-color: @book-cover-carousel-cards; From 31d929fe8b2a5cc4934880c3e4cb8f440f749160 Mon Sep 17 00:00:00 2001 From: RayBB Date: Sun, 26 May 2024 21:44:09 +0200 Subject: [PATCH 2/8] preload slick.woff on home page --- openlibrary/templates/home/index.html | 2 ++ static/css/components/home.less | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openlibrary/templates/home/index.html b/openlibrary/templates/home/index.html index dd19b759c71..bf77237f1b8 100644 --- a/openlibrary/templates/home/index.html +++ b/openlibrary/templates/home/index.html @@ -14,6 +14,8 @@ $add_metatag(name="twitter:image:alt", content="Open Library Logo") $add_metatag(name="twitter:card", content="homepage_summary") + +
diff --git a/static/css/components/home.less b/static/css/components/home.less index 90c08caa3ef..e87238c49ca 100644 --- a/static/css/components/home.less +++ b/static/css/components/home.less @@ -1,6 +1,5 @@ /* Homepage about section */ @import (less) "less/font-families.less"; -@import (less) "components/carousel--js.less"; div.tutorial__item { background-color: @book-cover-carousel-cards; From 01fd0c9d450a2d15ba763e47e479193d01f957b0 Mon Sep 17 00:00:00 2001 From: RayBB Date: Sun, 26 May 2024 21:52:29 +0200 Subject: [PATCH 3/8] preload in content body and lazy load correctly --- openlibrary/templates/books/custom_carousel.html | 4 +++- openlibrary/templates/home/index.html | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openlibrary/templates/books/custom_carousel.html b/openlibrary/templates/books/custom_carousel.html index afcc7571e63..a74b51c8a20 100644 --- a/openlibrary/templates/books/custom_carousel.html +++ b/openlibrary/templates/books/custom_carousel.html @@ -59,7 +59,9 @@
$if cover_url: - $('%s%s'%(title,byline)) -
+ + $:render_template("home/welcome", test=test) From d47b036720f1ea27fedc43f9b63eb54b388d3320 Mon Sep 17 00:00:00 2001 From: RayBB Date: Sun, 26 May 2024 21:55:24 +0200 Subject: [PATCH 4/8] closer $ --- openlibrary/templates/books/custom_carousel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlibrary/templates/books/custom_carousel.html b/openlibrary/templates/books/custom_carousel.html index a74b51c8a20..523e3c7b2ab 100644 --- a/openlibrary/templates/books/custom_carousel.html +++ b/openlibrary/templates/books/custom_carousel.html @@ -60,7 +60,7 @@ $if cover_url: $('%s%s'%(title,byline)) Date: Sun, 26 May 2024 21:59:24 +0200 Subject: [PATCH 5/8] move font preload to welcome.html --- openlibrary/templates/home/index.html | 2 -- openlibrary/templates/home/welcome.html | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlibrary/templates/home/index.html b/openlibrary/templates/home/index.html index 6a61af2882a..dd19b759c71 100644 --- a/openlibrary/templates/home/index.html +++ b/openlibrary/templates/home/index.html @@ -16,8 +16,6 @@ $add_metatag(name="twitter:card", content="homepage_summary")
- - $:render_template("home/welcome", test=test) diff --git a/openlibrary/templates/home/welcome.html b/openlibrary/templates/home/welcome.html index 41ee0861663..987d88a0d21 100644 --- a/openlibrary/templates/home/welcome.html +++ b/openlibrary/templates/home/welcome.html @@ -6,6 +6,8 @@

$_("Welcome to Open Library")