Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/head.html')
-rw-r--r--layouts/partials/head.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index a1e7a3f..f124cd1 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -54,16 +54,26 @@
<meta name="generator" content="Hugo Eureka {{ .Site.Data.eureka.version }}" />
-{{- $eurekaCSS := resources.Get "css/eureka.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint "sha384" }}
+{{- $eurekaCSS := resources.Get "css/eureka.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | resources.ExecuteAsTemplate "css/eureka.css" . | minify | fingerprint "sha384" }}
<link rel="stylesheet" href="{{ $eurekaCSS.Permalink }}" integrity="{{ $eurekaCSS.Data.Integrity }}">
{{- $eurekaJS := resources.Get "js/eureka.js" | resources.ExecuteAsTemplate "js/eureka.js" . | minify | fingerprint "sha384" }}
<script defer src="{{ $eurekaJS.Permalink }}" integrity="{{ $eurekaJS.Data.Integrity }}"></script>
+{{ $googleFonts := "" }}
+{{ range $index, $value := partial "utils/get-style-fonts" (dict "context" . "param" "googleFonts") }}
+{{ with $value }}
+{{ $googleFonts = print $googleFonts "family=" . "&" }}
+{{ end }}
+{{ end }}
+
+{{ with $googleFonts }}
+<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preload"
- href="https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Noto+Serif+SC:wght@400;600;700&display=swap"
+ href="{{ printf "https://fonts.googleapis.com/css2?%sdisplay=swap" . }}"
as="style" onload="this.onload=null;this.rel='stylesheet'">
+{{ end }}
{{- $assets := .Site.Data.assets }}