Still the same demo to be deployed, just on a different location than a separate branch this time.
1.1 KiB
title: "Twitter cards" date: 2020-10-20T20:31:32+08:00
categories: - "recipe" tags: - "twitter" - "social media" ---
Twitter cards
John Doe <johndoe@example.com> 2020-10-20 20:31:32 +0800 :stem: latexmath
This will add Twitter cards for your webpages.
(Be sure to copy the head
partial first in your own layout folder.)
Thankfully, Hugo already has an internal template for Twitter cards.
Simply add {{- template "_internal/twitter_cards.html" . -}}
somewhere in your own copy.
(For reference, here’s the source code for the internal template.)
You could also roll your own Twitter cards but I recommend to modify the internal template instead fitting your specific needs.
(Copy the internal template from the given link, create it as a partial in layouts/partials/twitter_cards.html
, modify it, and insert the template with {{- partial "twitter_cards.html" -}}
.)