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

github.com/marketempower/axiom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/styles-type.html')
-rw-r--r--layouts/partials/styles-type.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/partials/styles-type.html b/layouts/partials/styles-type.html
new file mode 100644
index 0000000..e73e19a
--- /dev/null
+++ b/layouts/partials/styles-type.html
@@ -0,0 +1,14 @@
+{{- if and (.Site.Params.font.files) (reflect.IsSlice .Site.Params.font.files) }}
+{{- $host := partial "cdn-src" (dict "Site" $.Site "Page" . "src" .Site.Params.font.path "type" "raw") }}
+{{- range .Site.Params.font.files }}
+<link rel="preload" href="{{ printf "%s%s" $host . | safeHTML }}" as="font" type="{{ $.Site.Params.font.type }}" crossorigin>
+{{- end }}
+
+{{- with resources.Get "type.css" }}
+{{- $vars := dict "host" $host "Site" $.Site "Page" . }}
+{{- $typeCSS := . | resources.ExecuteAsTemplate "type.css" $vars }}
+{{- $typeCSS = printf "%s?v=%d" $typeCSS.RelPermalink now.Unix }}
+<link rel="preload" as="style" href="{{ $typeCSS | safeHTML }}" media="all">
+<link rel="stylesheet" href="{{ $typeCSS | safeHTML }}" media="all">
+{{- end }}
+{{- end }}