improve seacrh

This commit is contained in:
2025-04-26 11:47:16 -03:00
parent a33fc0a34a
commit b27c164c2d
4 changed files with 63 additions and 21 deletions

View File

@@ -1,14 +0,0 @@
import { MeiliSearch } from "meilisearch";
import { fileURLToPath } from "node:url";
export default function meili() {
return {
name: "meili",
hooks: {
"astro:build:done": async ({ logger, dir }) => {
const pathToRead = fileURLToPath(dir);
console.log(pathToRead);
},
},
};
}

View File

@@ -55,7 +55,10 @@ const { Content } = await render(course);
) )
} }
</span> </span>
<h1 class="text-pretty font-semibold text-4xl lg:text-7xl" data-pagefind-meta="title"> <h1
class="text-pretty font-semibold text-4xl lg:text-7xl"
data-pagefind-meta="title"
>
{data.title} {data.title}
</h1> </h1>
<p class="text-base/6"> <p class="text-base/6">
@@ -63,11 +66,12 @@ const { Content } = await render(course);
<a <a
href="#modulos" href="#modulos"
class="text-blue-400 *:hover:underline" class="text-blue-400 *:hover:underline"
data-pagefind-ignore
> >
<sup>[1]</sup> <sup>[1]</sup>
</a> </a>
</p> </p>
<ul class="lg:flex gap-3"> <ul class="lg:flex gap-3" data-pagefind-ignore="all">
<li class="flex gap-1"> <li class="flex gap-1">
<Icon name="clock" class="size-5" /> <Icon name="clock" class="size-5" />
<span <span
@@ -94,6 +98,7 @@ const { Content } = await render(course);
<div <div
class="flex max-lg:flex-col justify-center gap-2.5 lg:gap-8 lg:mt-16" class="flex max-lg:flex-col justify-center gap-2.5 lg:gap-8 lg:mt-16"
data-pagefind-ignore="all"
> >
<a <a
href="#" href="#"

View File

@@ -5,7 +5,7 @@ import Layout from "~/layouts/Layout.astro";
import Container from "~/components/Container.astro"; import Container from "~/components/Container.astro";
import { Clients } from "~/components/Course"; import { Clients } from "~/components/Course";
import Search from "./_components/Search.astro"; import Search from "./_components/Search.astro";
//import Search from "astro-pagefind/components/Search"; // import Search from "astro-pagefind/components/Search";
import mulhercomepi from "~/assets/mulher-com-epi.png"; import mulhercomepi from "~/assets/mulher-com-epi.png";
--- ---
@@ -28,15 +28,23 @@ import mulhercomepi from "~/assets/mulher-com-epi.png";
</label> </label>
<div <div
class="flex gap-2.5 border border-black bg-white w-full rounded-lg relative" class="border border-black bg-white w-full rounded-lg relative"
> >
<label for="search" class="py-3.5 pl-3"> <!-- <label for="search" class="py-3.5 pl-3">
<Icon <Icon
name="magnifying-glass" name="magnifying-glass"
class="size-6" class="size-6"
/> />
</label> </label> -->
<Search uiOptions={{ showImages: false, resetStyles: true }} /> <Search
className="pagefind-ui"
uiOptions={{
showImages: false,
resetStyles: false,
pageSize: 5,
excerptLength: 0,
}}
/>
</div> </div>
</div> </div>

View File

@@ -10,3 +10,46 @@ html,
body { body {
@apply text-white bg-black scroll-pt-22 antialiased; @apply text-white bg-black scroll-pt-22 antialiased;
} }
.pagefind-ui {
@apply w-full;
}
.pagefind-ui__search-input {
@apply focus:outline-none w-full p-3.5 placeholder:text-white;
}
.pagefind-ui__search-clear {
@apply absolute right-0;
}
.pagefind-ui__result-excerpt,
.pagefind-ui__suppressed,
.pagefind-ui__hidden {
@apply hidden;
}
.pagefind-ui__drawer {
@apply absolute w-full top-full bg-white mt-1.5 p-5 rounded-xl drop-shadow space-y-2.5 z-5;
}
.pagefind-ui__results {
@apply empty:hidden space-y-1;
}
.pagefind-ui__results,
.pagefind-ui__button {
@apply mt-4;
}
.pagefind-ui__result {
@apply hover:underline;
}
.pagefind-ui__result-link {
@apply font-semibold block;
}
.pagefind-ui__button {
@apply text-center text-sm cursor-pointer hover:underline border border-gray-300 rounded-lg p-1.5 w-full;
}