···1+---
2+"@nulfrost/leaflet-loader-astro": minor
3+---
4+5+Added the ability to use a handle or did when specifying a repo for leafletStaticLoader and leafletLiveLoader
6+7+8+```ts
9+import { defineLiveCollection} from "astro:content";
10+import { leafletLiveLoader } from "leaflet-loader-astro";
11+12+const documents = defineLiveCollection({
13+ loader: leafletLiveLoader({ repo: "dane.computer" }), // or repo: did:plc:qttsv4e7pu2jl3ilanfgc3zn, both work!
14+});
15+16+export const collections = { documents };
17+```
+12-5
lib/leaflet-live-loader.ts
···1-import { isDid } from "@atproto/did";
02import type { LiveLoader } from "astro/loaders";
3import type {
4 CollectionFilter,
···10import {
11 getLeafletDocuments,
12 getSingleLeafletDocument,
013 leafletBlocksToHTML,
14 leafletDocumentRecordToView,
15 LiveLoaderError,
16 resolveMiniDoc,
17 uriToRkey,
18} from "./utils.js";
19-import { Client, simpleFetchHandler } from "@atcute/client";
2021export function leafletLiveLoader(
22 options: LiveLeafletLoaderOptions,
···35 );
36 }
3738- // not a valid did
39- if (!isDid(repo)) {
40- throw new LiveLoaderError("invalid did", "INVALID_DID");
00000041 }
4243 return {
···1+import { Client, simpleFetchHandler } from "@atcute/client";
2+import { isHandle } from "@atcute/lexicons/syntax";
3import type { LiveLoader } from "astro/loaders";
4import type {
5 CollectionFilter,
···11import {
12 getLeafletDocuments,
13 getSingleLeafletDocument,
14+ isPlcDid,
15 leafletBlocksToHTML,
16 leafletDocumentRecordToView,
17 LiveLoaderError,
18 resolveMiniDoc,
19 uriToRkey,
20} from "./utils.js";
02122export function leafletLiveLoader(
23 options: LiveLeafletLoaderOptions,
···36 );
37 }
3839+ // not a valid handle, check if valid did
40+ if (!isHandle(repo)) {
41+ // not a valid handle or did, throw
42+ if (!isPlcDid(repo)) {
43+ throw new LiveLoaderError(
44+ "invalid handle or did",
45+ "INVALID_HANDLE_OR_DID",
46+ );
47+ }
48 }
4950 return {
+11-3
lib/leaftlet-static-loader.ts
···1import { Client, simpleFetchHandler } from "@atcute/client";
02import { isDid } from "@atproto/did";
3import type { Loader, LoaderContext } from "astro/loaders";
4import { LeafletDocumentSchema } from "schema.js";
···8} from "types.js";
9import {
10 getLeafletDocuments,
011 leafletBlocksToHTML,
12 leafletDocumentRecordToView,
13 LiveLoaderError,
···27 );
28 }
2930- // not a valid did
31- if (!isDid(repo)) {
32- throw new LiveLoaderError("invalid did", "INVALID_DID");
00000033 }
3435 return {
···1import { Client, simpleFetchHandler } from "@atcute/client";
2+import { isHandle } from "@atcute/lexicons/syntax";
3import { isDid } from "@atproto/did";
4import type { Loader, LoaderContext } from "astro/loaders";
5import { LeafletDocumentSchema } from "schema.js";
···9} from "types.js";
10import {
11 getLeafletDocuments,
12+ isPlcDid,
13 leafletBlocksToHTML,
14 leafletDocumentRecordToView,
15 LiveLoaderError,
···29 );
30 }
3132+ // not a valid handle, check if valid did
33+ if (!isHandle(repo)) {
34+ // not a valid handle or did, throw
35+ if (!isPlcDid(repo)) {
36+ throw new LiveLoaderError(
37+ "invalid handle or did",
38+ "INVALID_HANDLE_OR_DID",
39+ );
40+ }
41 }
4243 return {