1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-20 21:21:16 -04:00

process SCSS @import rules with postcss-import

This commit is contained in:
2020-10-03 19:24:27 -04:00
parent 06c9cfe070
commit 9543aaa5b0
13 changed files with 149 additions and 101 deletions

View File

@@ -1,4 +1,4 @@
{{ partial "functions/meta-scratch" . -}}
{{ partial "head/init" . -}}
{{ partial "head/meta" . -}}
{{ partial "head/open-graph" . -}}
{{ partialCached "head/mobile" . -}}

View File

@@ -7,13 +7,3 @@
{{- end }}
<link rel="author" href="{{ "humans.txt" | absURL }}">
{{/* if this is a page/post, link View Source to specific file on GitHub. otherwise, just link to repo homepage. */}}
{{- with .Site.Params.social.githubRepo }}
{{- $githubURL := printf "https://github.com/%s" . }}
{{- if not $.IsPage }}
{{- $.Scratch.Set "sourceURL" $githubURL }}
{{- else }}
{{- $.Scratch.Set "sourceURL" (printf "%s/blob/main/content/%s" $githubURL $.File.Path) }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,39 @@
{{/* Strip any markdown styling from page title for use in meta tags */}}
{{- with .Title -}}
{{- $.Scratch.Set "plainTitle" (. | markdownify | htmlUnescape | plainify) -}}
{{- end -}}
{{/* If this is a page/post, link View Source to specific file on GitHub; otherwise, just link to repo homepage */}}
{{- with .Site.Params.social.githubRepo }}
{{- $githubURL := printf "https://github.com/%s" . }}
{{- if not $.IsPage }}
{{- $.Scratch.Set "sourceURL" $githubURL }}
{{- else }}
{{- $.Scratch.Set "sourceURL" (printf "%s/blob/main/content/%s" $githubURL $.File.Path) }}
{{- end }}
{{- end }}
{{/* Chooses and initializes various images for use by JSON schema & open graph tags */}}
{{/* Author image (default) */}}
{{- with .Site.Author.image -}}
{{- with resources.Get . -}}
{{- $.Scratch.Set "authorImage" . -}}
{{- end -}}
{{- end -}}
{{/* Page image (via frontmatter) */}}
{{- with .Params.image -}}
{{- with $.Page.Resources.GetMatch . -}}
{{- $.Scratch.Set "pageImage" . -}}
{{- end -}}
{{- else -}}
{{/* Fallback to author image set above */}}
{{- with $.Scratch.Get "authorImage" -}}
{{- $.Scratch.Set "pageImage" . -}}
{{- end -}}
{{- end -}}
{{/* Site logo */}}
{{- with .Site.Params.image -}}
{{- with resources.Get . -}}
{{- $.Scratch.Set "logoImage" . -}}
{{- end -}}
{{- end -}}

View File

@@ -1,4 +1,4 @@
{{ $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") }}
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "css/main.css") | 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 */}}