Skip to content

Commit

Permalink
feat(config): update config and improve asset handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vheissu committed Dec 15, 2024
1 parent e28a716 commit 1ee4263
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 13 additions & 1 deletion config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ theme = "aurelia-theme"
pathPrefix = ""

[outputs]
home = ["HTML", "RSS", "JSON"]
home = ["HTML", "RSS", "JSON"]

[build]
writeStats = true

[module]
[[module.mounts]]
source = "assets"
target = "assets"

[[module.mounts]]
source = "static"
target = "static"
9 changes: 4 additions & 5 deletions themes/aurelia-theme/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@

<link rel="search" href="{{ "index.json" | relURL }}" type="application/json">

<link rel="preload" href="{{ "css/search.css" | relURL }}" as="style">
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}

<link rel="stylesheet" href="{{ "css/search.css" | relURL }}">

{{ $css := resources.Get "css/main.css" | css.TailwindCSS }}
{{ if hugo.IsProduction }}
{{ $css = $css | minify | fingerprint | resources.PostProcess }}
{{ $css = $css | minify | fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous">
{{ else }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ end }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">

<script src="https://kit.fontawesome.com/ba181c6190.js" crossorigin="anonymous"></script>

0 comments on commit 1ee4263

Please sign in to comment.