Shortcode to embed Mastodon toots
- Add the repository as a Hugo module
hugo mod get github.com/ericswpark/hugo-mastodon-embed
- Add to your
config.toml
:
# Modules
[module]
# Other module imports here...
[[module.imports]]
path = "github.com/ericswpark/hugo-mastodon-embed"
disable = false
- Add the repository as a submodule
git submodule add https://github.com/ericswpark/hugo-mastodon-embed.git themes/hugo-mastodon-embed
- Add
hugo-mastodon-embed
as a theme in yourconfig.toml
:
theme = ["hugo-mastodon-embed", "default-theme-name"]
Add the following snippet where you want to embed a Mastodon toot:
{{< mastodon server_base="tilde.zone" username="ericswpark" toot_id="109522335209661741" >}}
If the default width of 800 is too big, you can change it:
{{< mastodon server_base="tilde.zone" username="ericswpark" toot_id="109522335209661741" width="400" >}}