hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

Make Twitter card's content value configurable

Open pfertyk opened this issue 1 year ago • 2 comments
trafficstars

Hi!

First of all: I would like to thank you for a wonderful Hugo theme! It has everything I need for my website :)

I have switched to Hugo after using Pelican, and I wanted to keep some things consistent with the previous version (e.g. URLs of articles, RSS file path, etc). This theme allowed me to configure practically everything except for Twitter cards. The configuration I had in Pelican used content="summary" while PaperMod uses content="summary_large_image".

I realize that it's not an urgent issue, but with only a square photo (of my face) available for my blog posts, the large image version looked really weird ... I ended up forking this repo and changing a single line of code: https://github.com/pfertyk/hugo-PaperMod/commit/a6c4a3c62072c77b4309e76221507533cb45a046

This works perfectly for me now, but do you think that maybe in the future PaperMod could have a config option to switch between different content types?

pfertyk avatar Apr 01 '24 13:04 pfertyk

Hi, yes that's the default with all hugo themes: https://github.com/gohugoio/hugo/blob/a6e84391760ca3786bf580344e2a013ac54b4b4a/tpl/tplimpl/embedded/templates/twitter_cards.html#L3

Right now unsure how to solve this without adding a config variable. Lets see

adityatelange avatar Apr 13 '24 06:04 adityatelange

I would be 100% OK with a config variable ;) I'm not sure how many content options are there for Twitter cards, but maybe it could just be a flag (use_summary_large_image, default true) ?

pfertyk avatar Apr 14 '24 11:04 pfertyk