1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 04:35:31 -04:00

stop hardcoding images/ directory in content frontmatter

This commit is contained in:
2020-04-16 09:34:58 -04:00
parent 9005c00112
commit 8537042ff1
28 changed files with 38 additions and 26 deletions

View File

@@ -3,7 +3,7 @@
<h1><a class="no-underline" href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<video
{{ with .Resources.GetMatch "images/*.png" }}poster="{{ .Permalink }}"{{ end }}
{{ with .Resources.GetMatch "thumb.*" }}poster="{{ .Permalink }}"{{ end }}
controls crossorigin playsinline preload="none">
{{ with .Resources.GetMatch "*.webm" }}<source src="{{ .Permalink }}" type="video/webm">{{ end }}
{{ with .Resources.GetMatch "*.mp4" }}<source src="{{ .Permalink }}" type="video/mp4">{{ end }}

View File

@@ -8,7 +8,7 @@
{{/* Article image (with fallback to default image */}}
{{- with .Params.image }}
{{- $imagePath := (path.Join "content" $.File.Dir "images/" .) }}
{{- $imagePath := (path.Join "content" $.File.Dir .) }}
{{- $.Scratch.Set "socialImage_url" (replace $imagePath "content/" "") }}
{{- with (imageConfig $imagePath) }}