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
1 changed files with 1 additions and 18 deletions

View File

@ -16,26 +16,9 @@
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" /> <meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
{{- end}} {{- end}}
<!-- Styles --> <!-- Styles -->
{{- $anoldhope := resources.Get "css/an-old-hope.min.css" }} {{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
{{- $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 -}}
<link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" <link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
as="style"> 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 --> <!-- Favicons -->
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}"> <link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
<link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}"> <link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">