diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-11-09 11:18:22 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-11-09 11:18:22 +0530 |
| commit | 64e8532a50879edf12eb76be98a4488d81812f45 (patch) | |
| tree | 7bdd83aa93842414d3be3c8c3064fe9742aaeeb6 | |
| parent | f9fbdc9963c37b8ee46196de3349d6769839da4d (diff) | |
head: load stylesheet resources with a wildcard
- include profile-mode
(cannot be done before f9fbdc9963c37b8ee46196de3349d6769839da4d)
- reduce request count from 2 to 1
improves perf :P
https://web.dev/resource-summary/
| -rw-r--r-- | layouts/partials/head.html | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a3e9975..0d7c0b3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -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 -}}"> |
