switch to ssg, add atcute, add iconify

This commit is contained in:
Badtz 2025-03-27 23:10:40 -07:00
parent b4bdb49c45
commit 72f418058f
12 changed files with 146 additions and 9 deletions

View file

@ -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
View 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
};
};

View file

@ -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>

View file

@ -0,0 +1,2 @@
<h1>Landing</h1>

View file

@ -0,0 +1,2 @@
<h1>Search</h1>

View 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>

View 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
}
};
};