fixed fetch not using root
This commit is contained in:
parent
3e46951317
commit
9b17ffa291
|
|
@ -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>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 />
|
||||
|
|
|
|||
Loading…
Reference in New Issue