diff --git a/src/lib/utils.ts b/src/lib/utils.ts --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -14,3 +14,30 @@ const info = await result.json(); return info; } + +export type Node = { + uri: string; + cid: string; + did: string; + indexedAt: string; + actorHandle: string; +} + +export type PublicationNode = Node & { value: { + url: string; + name: string; + description: string; +}} + +export type DocumentNode = Node & { value: { + title: string; + site: string; + publishedAt: string; + path?: string; + content?: string; + bskyPostRef?: string; + description?: string; + textContent?: string; + tags?: string[]; + updatedAt?: string; +}} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,53 @@ + +{#if publicationsQuery.isFetching} +

Fetching...

+{:else if publicationsQuery.isError} +

Error

+{:else if publicationsQuery.isSuccess} + {@const publications = publicationsQuery.data.pages.map((p) => p.siteStandardPublication.edges.map((edge) => edge.node)).flat()} + {#each publications as publication} + {publication.uri} +

{publication.value.url}

+ {/each} + {#if publicationsQuery.hasNextPage} + + {/if} +{/if} + diff --git a/src/routes/pub/+page.svelte b/src/routes/pub/+page.svelte new file mode 100644 --- /dev/null +++ b/src/routes/pub/+page.svelte @@ -0,0 +1,61 @@ + + +{#if documentsQuery.isFetching} +

Fetching...

+{:else if documentsQuery.isError} +

Error

+{:else if documentsQuery.isSuccess} + {@const documents = documentsQuery.data} + {#if documents.length === 0} +

No documents...

+ {:else} + {#each documents as document} +

{document.value.title}

+ {/each} + {/if} +{/if} + diff --git a/src/routes/[handle]/bookmarks/+page.svelte b/src/routes/[handle]/bookmarks/+page.svelte deleted file mode 100644 --- a/src/routes/[handle]/bookmarks/+page.svelte +++ /dev/null @@ -1,2 +0,0 @@ -