1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-28 15:10:30 -04:00
jarv.is/layouts/partials/functions/prepare-css.html
Jake Jarvis 3a3849e8ec
add a partial template that returns an asset's URL and hash from webpack's manifest
still a mess but slightly more modular. also added a real 404 page.
2021-09-03 11:16:27 -04:00

18 lines
590 B
HTML

{{/* Pull in CSS processed by Webpack */}}
{{- define "__head_css" -}}
{{ with partial "functions/webpack" (dict "context" . "src" "main.css") }}
<link rel="stylesheet" href="{{ .src }}">
{{ end }}
{{/* 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.scss" -}}
{{- $css := . | resources.FromString $target -}}
<style>
{{ $css.Content | safeCSS }}
</style>
{{- end -}}
{{- end -}}