Docs: update cdn (#291)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2023-09-13 09:29:17 +08:00
committed by GitHub
parent 6d438aafdf
commit 31dbcfde9f
2 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
{{ if .Site.Params.google_fonts }}
{{ $fonts := slice }}
{{ range .Site.Params.google_fonts }}
{{ $family := replace (index (.) 0) " " "+" }}
{{ $weights := replace (index (.) 1) " " "" }}
{{ $string := print $family ":" $weights }}
{{ $fonts = $fonts | append $string }}
{{ end }}
{{ $url_part := (delimit $fonts "|") | safeHTMLAttr }}
<link rel="preconnect" href="https://gstatic.loli.net/" />
<link rel="preconnect" href="https://gstatic.loli.net/" crossorigin />
<link {{ printf "href=\"https://fonts.loli.net/css?family=%s%s\"" $url_part "&display=block" | safeHTMLAttr }} rel="stylesheet">
{{ else}}
{{ end }}