19```
20
21If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
22
23```ts
80 {
81 "name": "Web Development",
82 "keywords": ["HTML5", "CSS", "Tailwind CSS", "React", "Next.js", "Vite", "FastAPI", "Hono", "Framer Motion"]
83 },
84 {
12 return await axios({
13 method: "POST",
14 url: `https://api.notion.com/v1/databases/${databaseId}/query`,
15 headers: {
16 Authorization: `Bearer ${notionAccessToken}`,
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
8const intervalMapping = {
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
8const intervalMapping = {
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
8const intervalMapping = {
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
8const intervalMapping = {
2import { configure, hits, pagination, searchBox } from "https://esm.sh/instantsearch.js@4.49.1/es/widgets";
3
4function validateConfig(): { appId: string; apiKey: string } {
5 const appId = Deno.env.get("ALGOLIA_APP_ID");
6 const apiKey = Deno.env.get("ALGOLIA_SEARCH_API_KEY");
7
8 if (!appId || !apiKey) {
9 throw new Error("Algolia credentials are not properly set");
10 }
11
12 return { appId, apiKey };
13}
14
15function generateHtml(appId: string, apiKey: string): string {
16 console.log("Generating HTML with App ID:", appId, "and API Key:", apiKey ? "exists" : "missing");
17 return `
18<!DOCTYPE html>
67 <script>
68 console.log("Initializing Algolia search with App ID:", "${appId}");
69 const searchClient = algoliasearch("${appId}", "${apiKey}");
70
71 const search = instantsearch({
124 console.log("Received request:", request.url);
125 try {
126 const { appId, apiKey } = validateConfig();
127 const html = generateHtml(appId, apiKey);
128 console.log("Generated HTML, length:", html.length);
129 return new Response(html, {
2import { configure, hits, pagination, searchBox } from "https://esm.sh/instantsearch.js@4.49.1/es/widgets";
3
4function validateConfig(): { appId: string; apiKey: string } {
5 const appId = Deno.env.get("ALGOLIA_APP_ID");
6 const apiKey = Deno.env.get("ALGOLIA_SEARCH_API_KEY");
7
8 if (!appId || !apiKey) {
9 throw new Error("Algolia credentials are not properly set");
10 }
11
12 return { appId, apiKey };
13}
14
15function generateHtml(appId: string, apiKey: string): string {
16 console.log("Generating HTML with App ID:", appId, "and API Key:", apiKey ? "exists" : "missing");
17 return `
18<!DOCTYPE html>
67 <script>
68 console.log("Initializing Algolia search with App ID:", "${appId}");
69 const searchClient = algoliasearch("${appId}", "${apiKey}");
70
71 const search = instantsearch({
124 console.log("Received request:", request.url);
125 try {
126 const { appId, apiKey } = validateConfig();
127 const html = generateHtml(appId, apiKey);
128 console.log("Generated HTML, length:", html.length);
129 return new Response(html, {
1Generate fake doc pages for testing in [Starlight](https://starlight.astro.build/) with its built in [components](https://starlight.astro.build/guides/components/) and [hacker jargon](https://fakerjs.dev/api/hacker) from [Faker](https://fakerjs.dev/).
2
3If you are looking to add the required `title` frontmatter for a batch of files you can use [this python script](https://gist.github.com/kmalloy24/6a4e20d30a773a7fc13ebdd4331cc73d) to interpret the `title` from the filename.