thegooddocsproject / website-hugo

Hugo based website for the project.
Other
6 stars 22 forks source link

Enable twitter cards for blog posts #163

Closed flicstar closed 2 years ago

flicstar commented 2 years ago

Hey @zivbk1 @bwklein want to watch another episode? https://www.loom.com/share/fcd5bfd1272243e587bb5bddf87cd45b

Just creating this issue for us to get twitter card images working. Yay.

flicstar commented 2 years ago

From Bryan:

The code doesn't allow for a single 'image' field to work. https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html So, I will see if there is a good approach that we can implement as a way of adding some array of images in the frontmatter UI.

bwklein commented 2 years ago

In the meantime, you could just manually add the images list into the frontmatter.

Something like this...

images:
- /uploads/blog/post-cover.jpg

It won't be supported in the Frontmatter UI until I extend the data type, but there is nothing keeping you from adding additional fields to the front matter data manually.

@flicstar

bwklein commented 2 years ago

Implemented #169