head: load stylesheet resources with a wildcard

- include profile-mode
  (cannot be done before f9fbdc9963)
- reduce request count from 2 to 1
  improves perf :P
  https://web.dev/resource-summary/
This commit is contained in:
Aditya Telange 2020-11-09 11:18:22 +05:30
parent f9fbdc9963
commit 64e8532a50
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -16,26 +16,9 @@
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
{{- end}}
<!-- Styles -->
{{- $anoldhope := resources.Get "css/an-old-hope.min.css" }}
{{- $theme := resources.Get "css/theme-vars.css" }}
{{- $reset := resources.Get "css/reset.css" }}
{{- $header := resources.Get "css/header.css" }}
{{- $main := resources.Get "css/main.css" }}
{{- $postentry := resources.Get "css/post-entry.css" }}
{{- $postsingle := resources.Get "css/post-single.css" }}
{{- $terms := resources.Get "css/terms.css" }}
{{- $archive := resources.Get "css/archive.css" }}
{{- $footer := resources.Get "css/footer.css" }}
{{- $404 := resources.Get "css/404.css" }}
{{- $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" }}
{{- $stylesheet := slice $anoldhope $style | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
<link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- if (and (.Site.Params.profileMode.enabled) (.IsHome)) }}
{{- $profileMode := slice (resources.Get "css/profile-mode.css") | resources.Concat "assets/css/profile-mode.css" | minify | fingerprint }}
<link href="{{ $profileMode.Permalink }}" integrity="{{ $profileMode.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- end -}}
<!-- Favicons -->
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
<link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">