From 1ee42631a9f5aafa46feebf669a61285e4b5f954 Mon Sep 17 00:00:00 2001 From: Dwayne Charrington Date: Mon, 16 Dec 2024 06:57:53 +1000 Subject: [PATCH] feat(config): update config and improve asset handling Added build stats tracking and defined module mounts for assets and static files in the configuration. Cleaned up the head template by removing redundant stylesheet links, ensuring proper loading of CSS with integrity checks in production. --- config/_default/config.toml | 14 +++++++++++++- themes/aurelia-theme/layouts/partials/head.html | 9 ++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/_default/config.toml b/config/_default/config.toml index 353cbaa..afe5365 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -7,4 +7,16 @@ theme = "aurelia-theme" pathPrefix = "" [outputs] - home = ["HTML", "RSS", "JSON"] \ No newline at end of file + home = ["HTML", "RSS", "JSON"] + +[build] + writeStats = true + +[module] + [[module.mounts]] + source = "assets" + target = "assets" + + [[module.mounts]] + source = "static" + target = "static" \ No newline at end of file diff --git a/themes/aurelia-theme/layouts/partials/head.html b/themes/aurelia-theme/layouts/partials/head.html index 90c0048..efa3fb8 100644 --- a/themes/aurelia-theme/layouts/partials/head.html +++ b/themes/aurelia-theme/layouts/partials/head.html @@ -15,16 +15,15 @@ - {{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }} - - {{ $css := resources.Get "css/main.css" | css.TailwindCSS }} {{ if hugo.IsProduction }} - {{ $css = $css | minify | fingerprint | resources.PostProcess }} + {{ $css = $css | minify | fingerprint }} + +{{ else }} + {{ end }} -