Skip to content

Commit

Permalink
chore: adding blog translations to search
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadienvan committed Apr 28, 2024
1 parent d5e4bd8 commit 1e44662
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions src/search/blog.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { create, insert } from "@orama/orama";
import * as inevitabot from "../pages/blog/inevitabot.md";
import * as asynchronousBatching from "../pages/blog/asynchronous-batching.md";
import * as asunchronousBatchingEn from "../pages/blog/en/asynchronous-batching.md";
import * as svalutazioneFrontend from "../pages/blog/svalutazione-frontend.md";
import * as svalutazioneFrontendEn from "../pages/blog/en/devaluing-frontend.md";
import * as ict from "../pages/blog/iterative-contract-testing.md";
import * as ictEn from "../pages/blog/en/iterative-contract-testing.md";

export default async function fill() {
const blogDB = await create({
Expand All @@ -16,39 +19,63 @@ export default async function fill() {
});

await insert(blogDB, {
title: `Blog: ${inevitabot.frontmatter.title}`,
title: `Blog: ${inevitabot.frontmatter.title} ๐Ÿ‡ฎ๐Ÿ‡น`,
date: inevitabot.frontmatter.date,
content: inevitabot.rawContent(),
url: "/blog/inevitabot",
});

await insert(blogDB, {
title: `Blog: ${asynchronousBatching.frontmatter.title}`,
title: `Blog: ${asynchronousBatching.frontmatter.title} ๐Ÿ‡ฎ๐Ÿ‡น`,
date: asynchronousBatching.frontmatter.date,
content: asynchronousBatching.rawContent(),
url: "/blog/asynchronous-batching",
});

await insert(blogDB, {
title: `Blog: ${svalutazioneFrontend.frontmatter.title}`,
title: `Blog: ${svalutazioneFrontend.frontmatter.title} ๐Ÿ‡ฎ๐Ÿ‡น`,
date: svalutazioneFrontend.frontmatter.date,
content: svalutazioneFrontend.rawContent(),
url: "/blog/svalutazione-frontend",
});

await insert(blogDB, {
title: `Blog: ${ict.frontmatter.title}`,
title: `Blog: ${ict.frontmatter.title} ๐Ÿ‡ฎ๐Ÿ‡น`,
date: ict.frontmatter.date,
content: ict.rawContent(),
url: "/blog/iterative-contract-testing",
});

return { instance: blogDB, params: {
tolerance: 3,
limit: 5,
boost: {
title: 5,
content: 0.1
await insert(blogDB, {
title: `Blog: ${asunchronousBatchingEn.frontmatter.title} ๐Ÿ‡ฌ๐Ÿ‡ง`,
date: asunchronousBatchingEn.frontmatter.date,
content: asunchronousBatchingEn.rawContent(),
url: "/blog/en/asynchronous-batching",
});

await insert(blogDB, {
title: `Blog: ${svalutazioneFrontendEn.frontmatter.title} ๐Ÿ‡ฌ๐Ÿ‡ง`,
date: svalutazioneFrontendEn.frontmatter.date,
content: svalutazioneFrontendEn.rawContent(),
url: "/blog/en/devaluing-frontend",
});

await insert(blogDB, {
title: `Blog: ${ictEn.frontmatter.title} ๐Ÿ‡ฌ๐Ÿ‡ง`,
date: ictEn.frontmatter.date,
content: ictEn.rawContent(),
url: "/blog/en/iterative-contract-testing",
});

return {
instance: blogDB,
params: {
tolerance: 3,
limit: 5,
boost: {
title: 5,
content: 0.1,
},
},
} };
};
}

0 comments on commit 1e44662

Please sign in to comment.