Skip to main content

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​

ExtensionWhat it addsSettings
classicThe old.reddit.com skin, light and dark palettes, the phone layout and the settings pagesbrand, logo (instance); hideThemeMenu
github, xp, facebook-retroThe other themesgithub, xp, facebookRetro
favorites★ buttons; favorites pinned to the subreddit barfavorites
searchSubreddit autocomplete and the !s, r/, !u and u/ shortcutssuggest
directory/subreddits: popular, new and NSFW subreddits with name searchnone
mediaGrid view, media filters, the viewer, video previews and infinite scrollgrid, gridFull, filter, expand, viewer, hoverPlay, autoplay, infinite
layoutThe live layout editor at /settings/layoutIts own, saved per browser
politicsHides political postshide

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.