map now working
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
---
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join, resolve } from 'node:path';
|
||||
import Base from '../../layouts/Base.astro';
|
||||
import ActivityDetail from '../../components/ActivityDetail.svelte';
|
||||
import type { BASIndex, ActivitySummary } from '../../lib/types';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const dataDir = process.env.BINCIO_DATA_DIR
|
||||
?? resolve(process.cwd(), '..', 'bincio_data');
|
||||
const raw = readFileSync(join(dataDir, 'index.json'), 'utf-8');
|
||||
const index: BASIndex = JSON.parse(raw);
|
||||
|
||||
return index.activities
|
||||
.filter(a => a.privacy !== 'private' && a.id)
|
||||
.map(a => ({
|
||||
params: { id: a.id },
|
||||
props: { activity: a },
|
||||
}));
|
||||
}
|
||||
|
||||
const { activity } = Astro.props as { activity: ActivitySummary };
|
||||
const base = import.meta.env.BASE_URL;
|
||||
---
|
||||
<Base title={`${activity.title} — BincioActivity`}>
|
||||
<ActivityDetail {activity} {base} client:only="svelte" />
|
||||
</Base>
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import ActivityFeed from '../components/ActivityFeed.svelte';
|
||||
---
|
||||
<Base title="BincioActivity — Feed">
|
||||
<h1 class="text-2xl font-bold text-white mb-6">Activities</h1>
|
||||
<ActivityFeed client:load />
|
||||
</Base>
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
import Base from '../../layouts/Base.astro';
|
||||
import StatsView from '../../components/StatsView.svelte';
|
||||
---
|
||||
<Base title="Stats — BincioActivity">
|
||||
<h1 class="text-2xl font-bold text-white mb-6">Stats</h1>
|
||||
<StatsView client:load />
|
||||
</Base>
|
||||
Reference in New Issue
Block a user