tangled
alpha
login
or
join now
flo-bit.dev
/
blento
21
fork
atom
your personal website on atproto - mirror
blento.app
21
fork
atom
overview
issues
pulls
pipelines
theming, small fixes
Florian
3 weeks ago
364a4e45
dc5f8040
+77
-3
6 changed files
expand all
collapse all
unified
split
src
lib
cards
content
StandardSiteDocumentListCard
index.ts
routes
[[actor=actor]]
blog
+layout.server.ts
+layout.svelte
events
+layout.server.ts
+layout.svelte
+page.svelte
+2
-2
src/lib/cards/content/StandardSiteDocumentListCard/index.ts
···
18
18
for (const record of records) {
19
19
const site = record.value.site as string;
20
20
21
21
-
if (site.startsWith('at://')) {
21
21
+
if (site && site.startsWith('at://')) {
22
22
if (!publications[site]) {
23
23
const siteParts = parseUri(site);
24
24
···
37
37
38
38
record.value.href = publications[site] + record.value.path;
39
39
} else {
40
40
-
record.value.href = site + record.value.path;
40
40
+
record.value.href = (site ?? '') + record.value.path;
41
41
}
42
42
}
43
43
+28
src/routes/[[actor=actor]]/blog/+layout.server.ts
···
1
1
+
import { getRecord } from '$lib/atproto/methods.js';
2
2
+
import type { Did } from '@atcute/lexicons';
3
3
+
import { getActor } from '$lib/actor.js';
4
4
+
5
5
+
export async function load({ params, platform, request }) {
6
6
+
const did = await getActor({ request, paramActor: params.actor, platform });
7
7
+
8
8
+
if (!did) return { accentColor: undefined, baseColor: undefined };
9
9
+
10
10
+
try {
11
11
+
const publication = await getRecord({
12
12
+
did: did as Did,
13
13
+
collection: 'site.standard.publication',
14
14
+
rkey: 'blento.self'
15
15
+
});
16
16
+
17
17
+
const preferences = publication?.value?.preferences as
18
18
+
| { accentColor?: string; baseColor?: string }
19
19
+
| undefined;
20
20
+
21
21
+
return {
22
22
+
accentColor: preferences?.accentColor,
23
23
+
baseColor: preferences?.baseColor
24
24
+
};
25
25
+
} catch {
26
26
+
return { accentColor: undefined, baseColor: undefined };
27
27
+
}
28
28
+
}
+9
src/routes/[[actor=actor]]/blog/+layout.svelte
···
1
1
+
<script lang="ts">
2
2
+
import ThemeScript from '$lib/website/ThemeScript.svelte';
3
3
+
4
4
+
let { data, children } = $props();
5
5
+
</script>
6
6
+
7
7
+
<ThemeScript accentColor={data.accentColor} baseColor={data.baseColor} />
8
8
+
9
9
+
{@render children()}
+28
src/routes/[[actor=actor]]/events/+layout.server.ts
···
1
1
+
import { getRecord } from '$lib/atproto/methods.js';
2
2
+
import type { Did } from '@atcute/lexicons';
3
3
+
import { getActor } from '$lib/actor.js';
4
4
+
5
5
+
export async function load({ params, platform, request }) {
6
6
+
const did = await getActor({ request, paramActor: params.actor, platform });
7
7
+
8
8
+
if (!did) return { accentColor: undefined, baseColor: undefined };
9
9
+
10
10
+
try {
11
11
+
const publication = await getRecord({
12
12
+
did: did as Did,
13
13
+
collection: 'site.standard.publication',
14
14
+
rkey: 'blento.self'
15
15
+
});
16
16
+
17
17
+
const preferences = publication?.value?.preferences as
18
18
+
| { accentColor?: string; baseColor?: string }
19
19
+
| undefined;
20
20
+
21
21
+
return {
22
22
+
accentColor: preferences?.accentColor,
23
23
+
baseColor: preferences?.baseColor
24
24
+
};
25
25
+
} catch {
26
26
+
return { accentColor: undefined, baseColor: undefined };
27
27
+
}
28
28
+
}
+9
src/routes/[[actor=actor]]/events/+layout.svelte
···
1
1
+
<script lang="ts">
2
2
+
import ThemeScript from '$lib/website/ThemeScript.svelte';
3
3
+
4
4
+
let { data, children } = $props();
5
5
+
</script>
6
6
+
7
7
+
<ThemeScript accentColor={data.accentColor} baseColor={data.baseColor} />
8
8
+
9
9
+
{@render children()}
+1
-1
src/routes/[[actor=actor]]/events/+page.svelte
···
125
125
{@const rkey = event.rkey}
126
126
<a
127
127
href="{actorPrefix}/events/{rkey}"
128
128
-
class="border-base-200 dark:border-base-800 hover:border-base-300 dark:hover:border-base-700 group block overflow-hidden rounded-2xl border transition-colors"
128
128
+
class="border-base-200 dark:border-base-800 hover:border-base-300 dark:hover:border-base-700 group block overflow-hidden rounded-2xl border transition-colors bg-base-100 dark:bg-base-900"
129
129
>
130
130
<!-- Thumbnail -->
131
131
<div class="p-4">