From 9b17ffa2913c081207a93de49bdef1981f1bbb89 Mon Sep 17 00:00:00 2001 From: Orion Reed Date: Sat, 12 Aug 2023 17:05:42 +0100 Subject: [PATCH] fixed fetch not using root --- src/pages/Posts.tsx | 15 +++++++++++---- src/pages/Stream.tsx | 3 +-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/Posts.tsx b/src/pages/Posts.tsx index ed5c939..72e25d9 100644 --- a/src/pages/Posts.tsx +++ b/src/pages/Posts.tsx @@ -10,7 +10,7 @@ import { } from '@mantine/core' import { friendlyDate, getJsonl } from '@/utils' -const posts = await getJsonl('posts.jsonl') +const posts = await getJsonl('/posts.jsonl') type Post = { slug: string @@ -20,7 +20,14 @@ type Post = { const useStyles = createStyles((theme) => ({ index: { - fontFamily: 'monospace', + fontFamily: theme.fontFamilyMonospace, + fontSize: '0.85em', + alignSelf: 'flex-end', + }, + date: { + fontFamily: theme.fontFamilyMonospace, + fontSize: '0.85em', + alignSelf: 'flex-end', }, })) @@ -35,8 +42,8 @@ function PostListItem({ slug, title, date, index }) { {title} - - {friendlyDate(date)} + + {friendlyDate(date, 'dd/MMM/yyyy')} ) diff --git a/src/pages/Stream.tsx b/src/pages/Stream.tsx index 09b3aab..e50cf3b 100644 --- a/src/pages/Stream.tsx +++ b/src/pages/Stream.tsx @@ -17,7 +17,7 @@ import { friendlyDate, getJsonl } from '@/utils' const search = signal('') -const streamItems = await getJsonl('stream.jsonl') +const streamItems = await getJsonl('/stream.jsonl') const miniSearch = new MiniSearch({ fields: ['text'], // fields to index for full-text search storeFields: ['date', 'text'], // fields to return with search results @@ -131,7 +131,6 @@ function Search() { export default function Stream() { const { classes } = useStyles() const results = !search.value ? streamItems : miniSearch.search(search.value) - return ( <>