1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 23:28:28 -04:00

17 lines
876 B
HTML

{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "css/main.css" "includePaths" (slice "node_modules/")) | resources.PostCSS (dict "config" "postcss.config.js") }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{/* Page-specific styles set via front matter, piped through PostCSS and inlined */}}
{{- with .Params.css -}}
{{/* NOTE: This file doesn't end up getting published (which is good) */}}
{{- $target := path.Join $.File.Dir "css/inline.css" -}}
{{- $css := . | resources.FromString $target | resources.PostCSS (dict "config" "postcss.config.js") -}}
{{/* Already being minified to my taste by PostCSS above */}}
{{ printf "<!-- htmlmin:ignore -->" | safeHTML -}}
<style>
{{ $css.Content | safeCSS }}
</style>
{{- printf "<!-- htmlmin:ignore -->" | safeHTML }}
{{ end -}}