From 5ae1a237278d9bf9df8812fa4110b0b5cf460841 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Fri, 17 Jun 2022 11:26:11 +1000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Bundle=20all=20CSS=20into=20a=20sin?= =?UTF-8?q?gle=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ layouts/partials/head.html | 30 +++++++++++++----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2b7a0..1308da1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Alt text to author image ([#8](https://github.com/jpanther/lynx/pull/8)) +- Expanded Emoji support in page titles ### Changed - Upgrade to Tailwind v3.1.3 and Typography v0.5.2 - Adjusted contrast of certain text to improve accessibility +- All CSS is now bundled into a single file for better performance ## [1.1.0] - 2021-11-06 diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 099862c..2f734a4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -10,8 +10,8 @@ {{ .Site.Title }} {{- else -}} - {{ .Title }} · {{ .Site.Title }} - + {{ .Title | emojify }} · {{ .Site.Title | emojify }} + {{- end }} {{/* Metadata */}} {{ with .Params.Description -}} @@ -32,25 +32,21 @@ {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{ end -}} - {{/* Styles */}} - {{ $mainCSS := resources.Get "css/compiled/main.css" }} - {{ $mainStyles := $mainCSS | resources.Minify | resources.Fingerprint "sha512" }} + {{/* Asset bundles */}} + {{ $assets := newScratch }} + {{ $cssMain := resources.Get "css/compiled/main.css" }} + {{ $assets.Add "css" (slice $cssMain) }} + {{ $cssCustom := resources.Get "css/custom.css" }} + {{ if $cssCustom }} + {{ $assets.Add "css" (slice $cssCustom) }} + {{ end }} + {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint "sha512" }} - {{ $customCSS := resources.Get "css/custom.css" }} - {{ if $customCSS }} - {{ $customStyles := $customCSS | resources.Minify | resources.Fingerprint "sha512" }} - - {{ end }} {{/* Icons */}} {{ if templates.Exists "partials/favicons.html" }} {{ partialCached "favicons.html" .Site }}