chadtmiller.com/knotless

Git hosted in your atproto account, on any stock PDS, fast enough for agents.

git clone knotless://chadtmiller.com/knotless

needs the knotless git helper. set it up

main
15 lines · 655 B Raw History
import type { PageLoad } from './$types';
import type { Feed } from '#lib/api/Feed.ts';
import type { Search } from '#lib/api/Search.ts';
import { data } from '#lib/data.ts';

/** Asked for `q`, the repositories that match it; else what happened. Neither, without an index. */
export const load: PageLoad = async (event) => {
	const q = event.url.searchParams.get('q');
	if (q !== null) {
		const search = await data<Search | null>(event, `/_data/search?q=${encodeURIComponent(q)}`, true);
		if (search) return { search, feed: null };
	}
	const feed = await data<Feed | null>(event, '/xrpc/dev.knotless.getFeed', true);
	return { search: null, feed };
};