Skip to content

Commit 6aedb76

Browse files
authored
fix(search): enable Pagefind in dev mode and translate to French (#50)
- Add @pagefind/default-ui to Vite optimizeDeps.include - Rename page title from Search to Recherche - Translate all Pagefind UI messages to French
1 parent 3bb9885 commit 6aedb76

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

--url

522 KB
Binary file not shown.

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default defineConfig({
4949
// See: https://github.com/withastro/astro/issues/14030
5050
plugins: [tailwindcss()],
5151
optimizeDeps: {
52+
include: ["@pagefind/default-ui"],
5253
exclude: ["@resvg/resvg-js"],
5354
},
5455
},

src/pages/search.astro

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { SITE } from "@/config";
1010
const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/";
1111
---
1212

13-
<Layout title={`Search | ${SITE.title}`}>
13+
<Layout title={`Recherche | ${SITE.title}`}>
1414
<Header />
1515
<Banner />
16-
<Main pageTitle="Search">
16+
<Main pageTitle="Recherche">
1717
<div id="pagefind-search" transition:persist data-backurl={backUrl}></div>
1818
</Main>
1919
<Footer />
@@ -40,9 +40,12 @@ const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/";
4040
showImages: false,
4141
showSubResults: true,
4242
translations: {
43-
zero_results: "No results",
44-
many_results: "[COUNT] results",
45-
one_result: "1 result",
43+
placeholder: "Rechercher...",
44+
zero_results: "Aucun résultat",
45+
many_results: "[COUNT] résultats",
46+
one_result: "1 résultat",
47+
clear_search: "Effacer",
48+
load_more: "Afficher plus de résultats",
4649
},
4750
processTerm: function (term: string) {
4851
params.set("q", term); // Update the `q` parameter in the URL

0 commit comments

Comments
 (0)