1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-12-03 04:18:57 -05:00

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.
This commit is contained in:
2021-09-03 11:16:27 -04:00
parent a304fa5079
commit 3a3849e8ec
13 changed files with 97 additions and 111 deletions

View File

@@ -15,10 +15,8 @@
{{/* Chooses and initializes various images for use by JSON schema & open graph tags */}}
{{/* Author image (default) */}}
{{- with .Site.Data.manifest -}}
{{- with index . $.Site.Author.image -}}
{{- $.Scratch.Set "authorImage" (dict "Permalink" (absURL .src) "Width" 1200 "Height" 1200 "MediaType" "image/jpeg") -}}
{{- end -}}
{{- with partial "functions/webpack" (dict "context" . "src" .Site.Author.image) -}}
{{- $.Scratch.Set "authorImage" (dict "Permalink" .src "Width" 1200 "Height" 1200 "MediaType" "image/jpeg") -}}
{{- end -}}
{{/* Page image (via frontmatter) */}}
{{- with .Params.image -}}
@@ -31,9 +29,8 @@
{{- $.Scratch.Set "pageImage" . -}}
{{- end -}}
{{- end -}}
{{/* Site logo */}}
{{- with .Site.Data.manifest -}}
{{- with index . $.Site.Params.image -}}
{{- $.Scratch.Set "logoImage" (dict "Permalink" (absURL .src) "Width" 2048 "Height" 2048 "MediaType" "image/png") -}}
{{- end -}}
{{- with partial "functions/webpack" (dict "context" . "src" .Site.Params.image) -}}
{{- $.Scratch.Set "logoImage" (dict "Permalink" .src "Width" 2048 "Height" 2048 "MediaType" "image/png") -}}
{{- end -}}