Extensions
Every feature Threadshift adds to Redlib is an extension in ext/, compiled into the binary at build time. Upstream files only gain a few hook lines (listed in NOTICE.md), so merging new Redlib releases stays cheap.
Built in
| Extension | What it adds | Settings |
|---|---|---|
classic | The old.reddit.com skin, light and dark palettes, the phone layout and the settings pages | brand, logo (instance); hideThemeMenu |
github, xp, facebook-retro | The other themes | github, xp, facebookRetro |
favorites | ★ buttons; favorites pinned to the subreddit bar | favorites |
search | Subreddit autocomplete and the !s, r/, !u and u/ shortcuts | suggest |
directory | /subreddits: popular, new and NSFW subreddits with name search | none |
media | Grid view, media filters, the viewer, video previews and infinite scroll | grid, gridFull, filter, expand, viewer, hoverPlay, autoplay, infinite |
layout | The live layout editor at /settings/layout | Its own, saved per browser |
politics | Hides political posts | hide |
Features explains each one from a visitor's side. Every setting can be set for the whole instance as REDLIB_EXT_<EXTENSION>_<KEY> (see Settings). Everything except classic requires classic, because it builds on the skin's markup.
Choosing what's built
extensions.toml lists what's compiled in, in load order. To choose for one build instead:
REDLIB_EXTENSIONS=classic,media make build # empty = stock Redlib
Writing your own
An extension is a folder with an extension.toml manifest. It can override Redlib's templates, add styles and scripts (bundled into /ext.css and /ext.js), serve assets, declare settings (which appear at /settings automatically) and add Rust routes in a server.rs. ext/README.md is the full reference, and Themes walks through a small one.