switch to ssg, add atcute, add iconify
This commit is contained in:
parent
b4bdb49c45
commit
72f418058f
12 changed files with 146 additions and 9 deletions
|
|
@ -1,7 +1,15 @@
|
|||
<script lang="ts">
|
||||
import '../app.css';
|
||||
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
{@render children()}
|
||||
<ul class="bg-gray-800 text-white p-4 flex space-x-4">
|
||||
<li><a href="/" aria-label="home" class="icon-[mynaui--home] text-gray-300"></a></li>
|
||||
<li><a href="/landing" aria-label="landing" class="icon-[mynaui--external-link] text-gray-300"></a></li>
|
||||
<li><a href="/search" aria-label="search" class="icon-[mynaui--search] text-gray-300"></a></li>
|
||||
<li><a href="/user/m.woach.me/" aria-label="user" class="icon-[mynaui--user] text-gray-300"></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="h-screen bg-gray-300 overflow-hidden">
|
||||
{@render children()}
|
||||
</div>
|
||||
|
|
|
|||
13
src/routes/+layout.ts
Normal file
13
src/routes/+layout.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { CredentialManager, XRPC } from '@atcute/client';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const prerender = true;
|
||||
export const trailingSlash = 'always';
|
||||
|
||||
export const load: LayoutLoad = async () => {
|
||||
const manager = new CredentialManager({ service: 'https://bsky.social' });
|
||||
const rpc = new XRPC({ handler: manager });
|
||||
return {
|
||||
rpc
|
||||
};
|
||||
};
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
|
||||
<h1>Home Page</h1>
|
||||
|
||||
|
|
|
|||
2
src/routes/landing/+page.svelte
Normal file
2
src/routes/landing/+page.svelte
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h1>Landing</h1>
|
||||
|
||||
2
src/routes/search/+page.svelte
Normal file
2
src/routes/search/+page.svelte
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h1>Search</h1>
|
||||
|
||||
12
src/routes/user/[handle]/+page.svelte
Normal file
12
src/routes/user/[handle]/+page.svelte
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<script lang="ts">
|
||||
import type { PageProps } from './$types';
|
||||
|
||||
let { data }: PageProps = $props();
|
||||
|
||||
|
||||
</script>
|
||||
<h1>{data.userData.handle}</h1>
|
||||
<h2>{data.userData.did}</h2>
|
||||
|
||||
|
||||
|
||||
18
src/routes/user/[handle]/+page.ts
Normal file
18
src/routes/user/[handle]/+page.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ parent, params }) => {
|
||||
const { rpc } = await parent();
|
||||
|
||||
const { data: userData } = await rpc.get('com.atproto.identity.resolveHandle', {
|
||||
params: {
|
||||
handle: params.handle
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
userData: {
|
||||
handle: params.handle,
|
||||
did: userData.did
|
||||
}
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue