fixed fetch not using root

This commit is contained in:
Orion Reed 2023-08-12 17:05:42 +01:00
parent 3e46951317
commit 9b17ffa291
2 changed files with 12 additions and 6 deletions

View File

@ -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 }) {
<Anchor href={`posts/${slug}`} color={black}>
{title}
</Anchor>
<Text color="dimmed" fs="italic">
{friendlyDate(date)}
<Text color="dimmed" fs="italic" className={classes.date}>
{friendlyDate(date, 'dd/MMM/yyyy')}
</Text>
</Group>
)

View File

@ -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 (
<>
<Header />