Hey.
I used the Twitter Card Template here.
{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}
{{- end -}}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}"/>
This file has been truncated. show original
The front matter:
title: “SCP Cheatsheet”
date: 2023-01-05T15:06:03Z
draft: false
categories: [“Linux”]
tags: [“SSH”, “Cheatsheet”]
featured_image: scpfeatured.png
showcomments: false
description: All you need to know about SCP
images:
images/featuredscp_hufdaa388111e5cf949af96851bf432d3f_46599_600x0_resize_box_3.png
https://cards-dev.twitter.com/validator
Shows now errors.
Title and Description work and show up.
Image url works.
Page source:
Any ideas?
Thanks!
Your card works fine for me in a tweet.
https://twittercommunity.com/t/card-error-unable-to-render-or-no-image-read-this-first/62736
As of mid 2022, preview functionality was removed from the Card Validator
idarek
January 5, 2023, 8:25pm
3
https://cards-dev.twitter.com/validator
This not working for couple months at least. Under all mighty chef twit this will not be fixed hence forget about this tool. Overall when you share it will work as expected.
1 Like
Thanks, works fine now. I changed nothing.
1 Like