Mogelijkheid om SCSS-bestanden op te splitsen, integrity-waarde wordt nu ingevuld, tags vriendelijker opgemaakt

This commit is contained in:
Michael Boelen 2023-05-21 00:42:05 +02:00
parent 031bc13507
commit 4a5c56bdb7
5 changed files with 91 additions and 11 deletions

View file

@ -33,14 +33,15 @@
{{ if .Params.tags }}
<section>
<h3>Tags</h3>
<div class="post-date">
<span class="g time">{{.Date.Format "January 2, 2006"}} </span> &#8729;
<div class="tags">
{{ $taxonomy := "tags" }} {{ with .Param $taxonomy }}
<ul>
{{ range $index, $tag := . }} {{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
<a href="{{ .Permalink }}">{{ $tag | urlize }}</a>
<li><a href="{{ .Permalink }}">{{ $tag | urlize }}</a></li>
{{- end -}} {{- end -}}
</ul>
{{ end }}
</div>
</div>
</section>
{{ end }}
</div>

View file

@ -1,5 +1,19 @@
{{ $styles := resources.Get "scss/styles.scss" | toCSS (dict "outputStyle" "compressed") | minify }}
{{ $styles_breadcrumb := resources.Get "scss/styles_breadcrumb.scss" | toCSS (dict "outputStyle" "compressed") | minify }}
{{ $styles_navigation_menu := resources.Get "scss/styles_navigation_menu.scss" | toCSS (dict "outputStyle" "compressed") | minify }}
{{ $styles_extra := resources.Get "scss/_extra.scss" | toCSS (dict "outputStyle" "compressed") | minify }}
<style>{{ $styles.Content | safeCSS }} {{ $styles_breadcrumb.Content | safeCSS }}{{ $styles_navigation_menu.Content | safeCSS }} {{ $styles_extra.Content | safeCSS }}</style>
{{/* Zoek alle scss-bestanden, combineer ze, zet om naar CSS, verkleinen en voorzien van fingerprint */}}
{{ $styles := resources.Match "scss/**.scss" | resources.Concat "combined.scss" | toCSS (dict "outputStyle" "compressed") | minify | fingerprint }}
<style integrity="{{ $styles.Data.Integrity }}">{{ $styles.Content | safeCSS }}</style>
{{/*
Work in progress
{{ if eq (getenv "HUGO_ENV") "development" }}
{{ $cssOpts := (dict "enableSourceMap" true "includePaths" (slice "node_modules/bulma" "assets/scss")) }}
{{ $styles := resources.Match "scss/**.scss" | resources.Concat "combined.scss" | toCSS $cssOpts | postCSS }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
{{ else }}
{{ $cssOpts := (dict "enableSourceMap" false "includePaths" (slice "node_modules/bulma" "assets/scss")) }}
{{ with $combined_styles := resources.Match "scss/*.scss" | toCSS $cssOpts | postCSS | minify | fingerprint }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
*/}}