Skip to content

ianmuchina/hugo-static-tweet

Repository files navigation

Warning Work in progress

hugo-static-tweet



Faster & smaller embedded tweets for Hugo websites.

Demo

Screenshots

Light Mode Dark Mode
light mode dark mode

Features

  • Text + Emojis
  • Images
  • Videos
  • Polls
  • Quote tweets
  • Opengraph Cards
  • Mixed Media (Video & Images in tweet)
  • Twemoji
  • Private Use Area Glyphs
  • Hashflags
  • Profile pics with shapes
  • Affiliate Badges
  • Script to backup data to json file
  • CSS Preflight
  • Most Ads eg: 3d ads
  • Unified Cards
  • Broken threads

Installation

Installation using hugo modules

If you don't already have a go.mod file run this command

hugo mod init github.com/user/project

Then add the theme to your configuration file.

# config.yaml
module:
  imports:
    - path: github.com/ianmuchina/hugo-static-tweet

Installation using git submodules

If you don't have a themes folder, create one then clone this git repository.

mkdir themes
cd themes
git clone https://github.com/ianmuchina/hugo-static-tweet.git

After that you can add the theme to your config file

theme: hugo-static-tweet

Usage

Display single tweet

{{<tweet id="20">}}
Text changing depending on mode. Light: 'So light!' Dark: 'So dark!'

Display a thread of tweets, requires an end id and an optional start id.

{{<tw-thread end="1455953461300785159">}}

Output


Display a thread within specific range

{{<tw-thread start="1390192903197188096" end="1390198695241535488" >}}

Output

Display thread as text content, like the threadreader app

{{<threadreader end="1386086808216244228">}}

Output

Customization

Disable image optimization

Add this to the page/post frontmatter to disable image optimization for tweets in current page. Useful when the image optimization makes the image blurry.

## post.md
params:
  optimizeImages: false

Tasks

  • Support for manually optimized images & avif
  • Document Styling

Releases

No releases published

Packages

No packages published

Languages