docs: document options for leafletLiveLoader

nulfrost 09340099 5f03b918

Changed files
+44 -6
lib
+40 -2
README.md
··· 16 16 ## Usage 17 17 18 18 <details> 19 - <summary>Build-time loader: leafletStaticLoader (recommended)</summary> 19 + <summary>Build-time loader: leafletStaticLoader **(recommended)**</summary> 20 + 20 21 ```ts 21 22 // src/content.config.ts 22 23 import { defineCollection, z } from "astro:content"; ··· 83 84 ``` 84 85 </details> 85 86 86 - ### Live loader: leafletLiveLoader 87 + <details> 88 + <summary>Live loader: leafletLiveLoader</summary> 87 89 88 90 ```ts 89 91 // astro.config.mjs ··· 159 161 160 162 <Content /> 161 163 ``` 164 + 165 + </details> 166 + 167 + ## Loader Options 168 + 169 + ### Static Loader 170 + 171 + ```ts 172 + leafletStaticLoader() 173 + ``` 174 + 175 + `repo`: This can be either your DID (did:plc:qttsv4e7pu2jl3ilanfgc3zn) or your handle (dane.is.extraordinarily.cool) 176 + 177 + `limit`: How many leaflet documents to return when calling `getCollection`. The default is 50 and the range is from 1 to 100. 178 + 179 + `reverse`: Whether or not to return the leaflet documents in reverse order. By default this is false. 180 + 181 + ### Live Loader 182 + 183 + ```ts 184 + leafletLiveLoader() 185 + ``` 186 + 187 + `repo`: This can be either your DID (did:plc:qttsv4e7pu2jl3ilanfgc3zn) or your handle (dane.is.extraordinarily.cool) 188 + 189 + > [!NOTE] 190 + > `getLiveCollection` supports a second argument where you can add additional filters, similar to the options you have access to for `leafletStaticLoader` 191 + 192 + ```ts 193 + getLiveCollection() 194 + ``` 195 + 196 + `limit`: How many leaflet documents to return when calling `getCollection`. The default is 50 and the range is from 1 to 100. 197 + 198 + `reverse`: Whether or not to return the leaflet documents in reverse order. By default this is false. 199 + 162 200 163 201 ## License 164 202
+4 -4
lib/types.ts
··· 5 5 6 6 export interface LiveLeafletLoaderOptions { 7 7 /** 8 - * @description Your repo is your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev 8 + * @description Your repo is your DID (did:plc... or did:web...) or handle (username.bsky.social). You can find this information using: https://pdsls.dev 9 9 */ 10 10 repo: string; 11 11 } 12 12 13 13 export interface StaticLeafletLoaderOptions { 14 14 /** 15 - * @description Your repo is your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev 15 + * @description Your repo is your DID (did:plc... or did:web...) or handle (username.bsky.social). You can find this information using: https://pdsls.dev 16 16 */ 17 17 repo: string; 18 18 /** 19 - * The number of records leaflet records to return for getCollection, the default being 50. The range can be from 1 to 100. 19 + * @description The number of records leaflet records to return for getCollection, the default being 50. The range can be from 1 to 100. 20 20 * @default 50 21 21 */ 22 22 limit?: number; 23 23 /** 24 - * Whether or not the records should be returned in reversed order. 24 + * @description Whether or not the records should be returned in reverse order. 25 25 * @default undefined 26 26 */ 27 27 reverse?: boolean;