mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 12:35:31 -04:00
*much* smarter way of setting page-specific CSS
via front matter instead of flaky shortcode/page scratch
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{{ partial "head/open-graph" . -}}
|
||||
{{ partialCached "head/mobile" . -}}
|
||||
{{ partial "head/preload" . -}}
|
||||
{{ partialCached "head/styles" . -}}
|
||||
{{ partial "head/styles" . -}}
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}}
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
@@ -19,10 +19,3 @@
|
||||
{{ else }}
|
||||
{{ partial "head/schema-person" . }}
|
||||
{{ end -}}
|
||||
|
||||
{{/* Page-specific styles set via page-css shortcode */}}
|
||||
{{- with .Page.Scratch.Get "css" }}
|
||||
<style>
|
||||
{{- . | safeCSS -}}
|
||||
</style>
|
||||
{{ end -}}
|
||||
|
@@ -1,2 +1,9 @@
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
|
||||
{{/* Page-specific styles set via front matter */}}
|
||||
{{ with .Params.css }}
|
||||
<style>
|
||||
{{ . | safeCSS }}
|
||||
</style>
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user