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' } from '@mantine/core'
import { friendlyDate, getJsonl } from '@/utils' import { friendlyDate, getJsonl } from '@/utils'
const posts = await getJsonl('posts.jsonl') const posts = await getJsonl('/posts.jsonl')
type Post = { type Post = {
slug: string slug: string
@ -20,7 +20,14 @@ type Post = {
const useStyles = createStyles((theme) => ({ const useStyles = createStyles((theme) => ({
index: { 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}> <Anchor href={`posts/${slug}`} color={black}>
{title} {title}
</Anchor> </Anchor>
<Text color="dimmed" fs="italic"> <Text color="dimmed" fs="italic" className={classes.date}>
{friendlyDate(date)} {friendlyDate(date, 'dd/MMM/yyyy')}
</Text> </Text>
</Group> </Group>
) )

View File

@ -17,7 +17,7 @@ import { friendlyDate, getJsonl } from '@/utils'
const search = signal('') const search = signal('')
const streamItems = await getJsonl('stream.jsonl') const streamItems = await getJsonl('/stream.jsonl')
const miniSearch = new MiniSearch({ const miniSearch = new MiniSearch({
fields: ['text'], // fields to index for full-text search fields: ['text'], // fields to index for full-text search
storeFields: ['date', 'text'], // fields to return with search results storeFields: ['date', 'text'], // fields to return with search results
@ -131,7 +131,6 @@ function Search() {
export default function Stream() { export default function Stream() {
const { classes } = useStyles() const { classes } = useStyles()
const results = !search.value ? streamItems : miniSearch.search(search.value) const results = !search.value ? streamItems : miniSearch.search(search.value)
return ( return (
<> <>
<Header /> <Header />