Add Lotusdocs theme
This commit is contained in:
14
themes/lotusdocs/layouts/partials/google-fonts.html
Normal file
14
themes/lotusdocs/layouts/partials/google-fonts.html
Normal 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://fonts.gstatic.com/" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />
|
||||
<link {{ printf "href=\"https://fonts.googleapis.com/css?family=%s%s\"" $url_part "&display=block" | safeHTMLAttr }} rel="stylesheet">
|
||||
{{ else}}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user