DocsPlugins
Pins
The feeds and pages each person keeps in their own list, in their order, in folders with names and icons.
The pins plugin keeps a sidebar short. Instead of every feed or page a person may read, it shows the ones they pinned; they find the rest by searching and pin them from there. Pinning a feed is following it. To add it:
sluurp plugin add pinsFeatures include:
- One list per person, in the order they arrange
- Folders, with a name and an emoji or an icon
- Everything they may read pinned, until they first change the list
- A pin to something they can no longer read is hidden, and comes back if they can again
There is nothing to set up in the admin.
Use it in your app
import "plugin:pins";
const { items } = await sluurp.pins.list(); // [{ kind: "feed", id: "school" }, …]
await sluurp.pins.pin("page", "launch-plan");
await sluurp.pins.unpin("feed", "staffroom");To change the order, or to put pins in folders, send the whole list back with arrange(items). A folder is a pin of kind feed-folder or page-folder, with a label and an icon; a pin in a folder names it in its folder.
Make your plugin’s things pinnable
What may be pinned comes from the plugins. A plugin adds a pins.ts that says its kind, what the person may read of it, and what they keep whatever they do:
export const rule = "";
export const runAs = "system";
export default (ctx) => ({ kind: "feed", readable: feedsTheyMayRead(ctx), kept: [] });It is asked on the person’s behalf (ctx.auth is them), so readable is what they may read. kept lists what stays in their list whatever they do, such as a page they made.