mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-24 05:31:17 -04:00
clean up partials and styles
This commit is contained in:
32
layouts/partials/seo/social-images.html
Normal file
32
layouts/partials/seo/social-images.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- /* Default image */ -}}
|
||||
{{- $defaultImagePath := (path.Join "content" $.Site.Params.defaultimage) }}
|
||||
{{- $.Scratch.Set "defaultImage_url" (replace $defaultImagePath "content/" $.Site.BaseURL) }}
|
||||
{{- with (imageConfig $defaultImagePath) }}
|
||||
{{- $.Scratch.Set "defaultImage_width" .Width }}
|
||||
{{- $.Scratch.Set "defaultImage_height" .Height }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Article image (with fallback to default image */ -}}
|
||||
{{- with .Params.image }}
|
||||
{{- $imagePath := (path.Join "content" $.File.Dir "images/" .) }}
|
||||
|
||||
{{- $.Scratch.Set "socialImage_url" (replace $imagePath "content/" $.Site.BaseURL) }}
|
||||
{{- with (imageConfig $imagePath) }}
|
||||
{{- $.Scratch.Set "socialImage_width" .Width }}
|
||||
{{- $.Scratch.Set "socialImage_height" .Height }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "socialImage_url" (replace $defaultImagePath "content/" $.Site.BaseURL) }}
|
||||
{{- with (imageConfig $defaultImagePath) }}
|
||||
{{- $.Scratch.Set "socialImage_width" .Width }}
|
||||
{{- $.Scratch.Set "socialImage_height" .Height }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Site logo */ -}}
|
||||
{{- $logoImagePath := (path.Join "content" "logo.png") }}
|
||||
{{- $.Scratch.Set "logoImage_url" (replace $logoImagePath "content/" $.Site.BaseURL) }}
|
||||
{{- with (imageConfig $logoImagePath) }}
|
||||
{{- $.Scratch.Set "logoImage_width" .Width }}
|
||||
{{- $.Scratch.Set "logoImage_height" .Height }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user