Update featuredImage to use page bundle approach
This commit is contained in:
@@ -3,10 +3,13 @@ title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
|||||||
date: {{ .Date }}
|
date: {{ .Date }}
|
||||||
description: ""
|
description: ""
|
||||||
categories: []
|
categories: []
|
||||||
featuredImage: ""
|
|
||||||
featuredImageDescription: ""
|
|
||||||
dropCap: true
|
dropCap: true
|
||||||
displayInMenu: false
|
displayInMenu: false
|
||||||
displayInList: true
|
displayInList: true
|
||||||
draft: true
|
draft: true
|
||||||
|
resources:
|
||||||
|
- name: featuredImage
|
||||||
|
src: ""
|
||||||
|
params:
|
||||||
|
description: ""
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)"
|
<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)"
|
||||||
href="{{ .Permalink }}" class="card blog-card" rel="bookmark" >
|
href="{{ .Permalink }}" class="card blog-card" rel="bookmark" >
|
||||||
{{ if isset .Params "featuredimage" }}
|
{{ with .Resources.GetMatch "featuredImage" }}
|
||||||
<div class="card-img-container">
|
<div class="card-img-container">
|
||||||
<p class="card-img-overlay">Next Article</p>
|
<p class="card-img-overlay">Next Article</p>
|
||||||
<picture>
|
<picture>
|
||||||
{{ if (fileExists (printf "%s/%s" "static" (replace (.Params.featuredimage) (path.Ext .Params.featuredimage) ".webp"))) -}}
|
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
|
||||||
<source srcset="{{ replace (.Params.featuredimage) (path.Ext (.Params.featuredimage)) ".webp" | absURL }}" type="image/webp">
|
<source srcset="{{ .Permalink }}" type="image/webp">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<source srcset="{{ .Params.featuredimage | absURL }}">
|
<source srcset="{{ .Permalink }}">
|
||||||
<img src="{{.Params.featuredimage | absURL }}" class="card-img" {{ if isset .Params "featuredimagedescription" }}alt="{{.Params.featuredimagedescription}}"{{end}}>
|
<img src="{{ .Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)"
|
<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)"
|
||||||
href="{{ .Permalink }}" class="card blog-card" rel="bookmark" >
|
href="{{ .Permalink }}" class="card blog-card" rel="bookmark" >
|
||||||
{{ if isset .Params "featuredimage" -}}
|
{{ with .Resources.GetMatch "featuredImage" }}
|
||||||
<div class="card-img-container">
|
<div class="card-img-container">
|
||||||
<picture>
|
<picture>
|
||||||
{{ if (fileExists (printf "%s/%s" "static" (replace (.Params.featuredimage) (path.Ext .Params.featuredimage) ".webp"))) -}}
|
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
|
||||||
<source srcset="{{ replace (.Params.featuredimage) (path.Ext (.Params.featuredimage)) ".webp" | absURL }}" type="image/webp">
|
<source srcset="{{ .Permalink }}" type="image/webp">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<source srcset="{{ .Params.featuredimage | absURL }}">
|
<source srcset="{{ .Permalink }}">
|
||||||
<img src="{{.Params.featuredimage | absURL }}" class="card-img" {{ if isset .Params "featuredimagedescription" }}alt="{{.Params.featuredimagedescription}}"{{end}}>
|
<img src="{{ .Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
<h1 class="post-title">{{ .Title }}</h1>
|
<h1 class="post-title">{{ .Title }}</h1>
|
||||||
<p class="post-date">Posted <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "Jan 2, 2006" }}</time></p>
|
<p class="post-date">Posted <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "Jan 2, 2006" }}</time></p>
|
||||||
</header>
|
</header>
|
||||||
{{ if isset .Params "featuredimage" }}
|
{{ with .Resources.GetMatch "featuredImage" }}
|
||||||
<picture class="post-figure">
|
<picture class="post-figure">
|
||||||
{{ if (fileExists (printf "%s/%s" "static" (replace (.Params.featuredimage) (path.Ext (.Params.featuredimage)) ".webp"))) -}}
|
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
|
||||||
<source srcset="{{ replace (.Params.featuredimage) (path.Ext (.Params.featuredimage)) ".webp" | absURL }}" type="image/webp">
|
<source srcset="{{ .Permalink }}" type="image/webp">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<source srcset="{{.Params.featuredimage | absURL }}">
|
<source srcset="{{ .Permalink }}">
|
||||||
<img src="{{.Params.featuredimage | absURL }}" {{ if isset .Params "featuredimagedescription" }}alt="{{.Params.featuredimagedescription}}"{{end}}>
|
<img src="{{ .Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
|
||||||
</picture>
|
</picture>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|||||||
Reference in New Issue
Block a user