Compare commits

...

2 Commits

Author SHA1 Message Date
f198ec4e40 feat: make search more like regular posts thanks to directus
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-03 00:31:29 +07:00
9050f39911 feat: update plachta for finally consistent ratios 2024-12-03 00:31:12 +07:00
3 changed files with 24 additions and 24 deletions

27
package-lock.json generated
View File

@ -8,9 +8,8 @@
"name": "@damillora/shallie",
"version": "1.0.0",
"dependencies": {
"@damillora/plachta": "^6.5.0",
"@directus/sdk": "^18.0.0",
"main": "^1000.0.1"
"@damillora/plachta": "^6.6.0",
"@directus/sdk": "^18.0.0"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
@ -56,9 +55,9 @@
}
},
"node_modules/@damillora/plachta": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/@damillora/plachta/-/plachta-6.5.0.tgz",
"integrity": "sha512-3QJtNCYLlRm/pxqDrUNWX/LtMexxGac+LeIVmsHviLtBjk06XAHQ14TeBLHzE1UMFDXkz4jmzBe+sZkCjUdD1A==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@damillora/plachta/-/plachta-6.6.0.tgz",
"integrity": "sha512-P8MWjHrcQPU1TKJEVQXxN7Wzl93NjAFBDzi6szSOfx3qTQ6GENIObdctU9Q5k4wRcZySguC8Hhw7ux2E9SCh1A==",
"dependencies": {
"svelte": "^5.0.0"
}
@ -3019,11 +3018,6 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
"node_modules/main": {
"version": "1000.0.1",
"resolved": "https://registry.npmjs.org/main/-/main-1000.0.1.tgz",
"integrity": "sha512-zhB0yIsogMo0xGJEusCzS4I13ejvhEJ1MOWi1OR4n77HyhlqgvNNwhOOt5moSdTYd+Vi8B4wPE/MDmhquNHxrA=="
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@ -4421,9 +4415,9 @@
}
},
"@damillora/plachta": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/@damillora/plachta/-/plachta-6.5.0.tgz",
"integrity": "sha512-3QJtNCYLlRm/pxqDrUNWX/LtMexxGac+LeIVmsHviLtBjk06XAHQ14TeBLHzE1UMFDXkz4jmzBe+sZkCjUdD1A==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@damillora/plachta/-/plachta-6.6.0.tgz",
"integrity": "sha512-P8MWjHrcQPU1TKJEVQXxN7Wzl93NjAFBDzi6szSOfx3qTQ6GENIObdctU9Q5k4wRcZySguC8Hhw7ux2E9SCh1A==",
"requires": {
"svelte": "^5.0.0"
}
@ -6296,11 +6290,6 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
"main": {
"version": "1000.0.1",
"resolved": "https://registry.npmjs.org/main/-/main-1000.0.1.tgz",
"integrity": "sha512-zhB0yIsogMo0xGJEusCzS4I13ejvhEJ1MOWi1OR4n77HyhlqgvNNwhOOt5moSdTYd+Vi8B4wPE/MDmhquNHxrA=="
},
"merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",

View File

@ -45,8 +45,7 @@
},
"type": "module",
"dependencies": {
"@damillora/plachta": "^6.5.0",
"@directus/sdk": "^18.0.0",
"main": "^1000.0.1"
"@damillora/plachta": "^6.6.0",
"@directus/sdk": "^18.0.0"
}
}

View File

@ -2,12 +2,13 @@
import { page } from '$app/stores';
import { browser } from '$app/environment';
import { Container, Hero, Index, SearchCard } from '@damillora/plachta';
import { Container, Hero, Index, Post, PostCard } from '@damillora/plachta';
import { onMount } from 'svelte';
import { search } from '$lib/content/searchApi';
import { afterNavigate } from '$app/navigation';
import { searchPost } from '$lib/content/contentApi.js';
import dayjs from 'dayjs';
let { data } = $props();
let posts: any[] = $state([]);
@ -64,9 +65,20 @@
<Hero background="/images/default-feature.jpg" />
<Container>
<Index>
<h1>Search results for: {url.searchParams.get('q')}</h1>
</Index>
<Index>
{#each posts as post}
<SearchCard title={post.title} url={post.url} excerpt={post.excerpt} />
<PostCard
title={post.title}
authors={post.authors}
primary_tag={post.category}
date={dayjs(post.date_published).format('DD MMM YYYY')}
excerpt={post.excerpt}
feature_image={post.feature_image ?? '/images/default-feature.jpg'}
url={post.url}
/>
{/each}
</Index>
<div bind:this={footer}></div>