mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-18 12:13:42 +00:00
1 parent
486c70c216
commit
cd023168da
1 file changed
+10
-3
@@ -114,10 +114,17 @@
|
|||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* We cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
|
{{/* Load Google Fonts if the site's Font Theme uses them. */}}
|
||||||
{{/* Hugo's htmlEscape cannot escape "|" in Google Font URIs so we implement our own escape functionality. */}}
|
{{/* Note: we cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
|
||||||
{{ with ($scr.Get "google_fonts") }}
|
{{ with ($scr.Get "google_fonts") }}
|
||||||
<link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" . | replaceRE "\\|" "%7C" | safeHTMLAttr }}>
|
{{ if hasPrefix . "family=" }}
|
||||||
|
{{/* If `google_fonts` starts with "family=", use API v2 (https://developers.google.com/fonts/docs/css2) */}}
|
||||||
|
<link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css2?%s&display=swap\"" . | safeHTMLAttr }}>
|
||||||
|
{{ else }}
|
||||||
|
{{/* Otherwise, use API v1 */}}
|
||||||
|
{{/* Hugo's htmlEscape cannot escape "|" in Google Font URIs so we implement our own escape functionality. */}}
|
||||||
|
<link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" . | replaceRE "\\|" "%7C" | safeHTMLAttr }}>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $css_comment := printf "/*!* Source Themes Academic v%s (https://sourcethemes.com/academic/) */\n" site.Data.academic.version }}
|
{{ $css_comment := printf "/*!* Source Themes Academic v%s (https://sourcethemes.com/academic/) */\n" site.Data.academic.version }}
|
||||||
|
|||||||
Reference in new issue
Block a user