Optimize loading Google Fonts
This commit is contained in:
parent
72355f3053
commit
8c040b0187
1 changed files with 8 additions and 1 deletions
|
@ -4,6 +4,9 @@
|
|||
(:export #:~scripts))
|
||||
(in-package #:website/components/scripts)
|
||||
|
||||
(defparameter *google-font-url*
|
||||
"https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&display=swap")
|
||||
|
||||
(defun bust-cache (url)
|
||||
(format nil "~a?v=~a" url #.(get-universal-time)))
|
||||
|
||||
|
@ -11,8 +14,12 @@
|
|||
(hsx
|
||||
(<>
|
||||
(link :rel "stylesheet" :href (bust-cache "/style/dist.css"))
|
||||
(link :rel "preconnect" :href "https://fonts.gstatic.com" :crossorigin t)
|
||||
(link :rel "preconnect" :href "https://fonts.googleapis.com")
|
||||
(link :rel "stylesheet" :href "https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&display=swap")
|
||||
(link :rel "preload" :as "style" :fetchpriority "high" :href *google-font-url*)
|
||||
(link :rel "stylesheet" :href *google-font-url* :media "print" :onload "this.media='all'")
|
||||
(noscript
|
||||
(link :rel "stylesheet" :href *google-font-url*))
|
||||
(script :src "https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js")
|
||||
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-preload@2.1.1/dist/preload.min.js")
|
||||
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-head-support@2.0.4/dist/head-support.min.js")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue