From 6451983aaa9c0deb5a27d781af341b1dcffb6f69 Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Tue, 11 Feb 2025 12:49:05 +0000 Subject: [PATCH] [Docs Site] Refactor single-file collections, handle external links --- src/components/AnchorHeading.astro | 14 +- src/components/ExternalResources.astro | 36 +- src/components/ListTutorials.astro | 72 +-- src/content.config.ts | 6 +- src/content/apps/index.yaml | 685 ++++++++++---------- src/content/videos/index.yaml | 841 ++++++++++++------------- src/schemas/apps.ts | 29 +- src/schemas/videos.ts | 37 +- src/util/rehype.ts | 13 + 9 files changed, 862 insertions(+), 871 deletions(-) create mode 100644 src/util/rehype.ts diff --git a/src/components/AnchorHeading.astro b/src/components/AnchorHeading.astro index 8374cd15596e791..4a9bbb6c19d8bf7 100644 --- a/src/components/AnchorHeading.astro +++ b/src/components/AnchorHeading.astro @@ -3,7 +3,7 @@ import { z } from "astro:schema"; import { marked } from "marked"; import { slug as GithubSlug } from "github-slugger"; -import { rehype } from "rehype"; +import { process } from "~/util/rehype"; import rehypeAutoLinkHeadings from "~/plugins/rehype/autolink-headings"; type Props = z.infer; @@ -20,14 +20,10 @@ const slugified = GithubSlug(slug ?? title); const tag = `h${depth}` as "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; -const file = await rehype() - .data("settings", { - fragment: true, - }) - .use(rehypeAutoLinkHeadings) - .process(`<${tag} id=${slugified}>${marked.parseInline(title)}`); - -const html = file.toString(); +const html = await process( + `<${tag} id=${slugified}>${marked.parseInline(title)}`, + [rehypeAutoLinkHeadings], +); --- diff --git a/src/components/ExternalResources.astro b/src/components/ExternalResources.astro index 18476d8297a48b6..87b5f8d04c7cce4 100644 --- a/src/components/ExternalResources.astro +++ b/src/components/ExternalResources.astro @@ -1,7 +1,10 @@ --- -import { getEntry } from "astro:content"; +import { getCollection } from "astro:content"; import { z } from "astro:schema"; +import { process } from "~/util/rehype"; +import rehypeExternalLinks from "~/plugins/rehype/external-links"; + type Props = z.infer; const props = z.object({ @@ -13,33 +16,34 @@ const props = z.object({ const { type, tags, products, cloudflareOnly } = props.parse(Astro.props); -const resources = await getEntry(type, "index"); - -if (!resources) { - throw new Error("Failed to load data"); -} - -const filtered = resources.data.entries.filter((entry) => { +const resources = await getCollection(type, (e) => { return ( - (cloudflareOnly ? entry.cloudflare : true) && - (tags ? entry.tags?.some((v: string) => tags.includes(v)) : true) && + (cloudflareOnly ? e.data.cloudflare : true) && + (tags ? e.data.tags?.some((v: string) => tags.includes(v)) : true) && (products - ? entry.products?.some((v: string) => products.includes(v)) + ? e.data.products?.some((v: string) => products.includes(v)) : true) ); }); -filtered.sort((a, b) => Number(b.updated) - Number(a.updated)); +if (!resources) { + throw new Error("Failed to load data"); +} + +resources.sort((a, b) => Number(b.data.updated) - Number(a.data.updated)); ---
    { - filtered.map((entry) => { - const title = "name" in entry ? entry.name : entry.title; + resources.map(async (e) => { + const anchor = await process(`${e.id}:`, [ + rehypeExternalLinks, + ]); + return (
  • - {title}: - {entry.description} + + {e.data.description}
  • ); }) diff --git a/src/components/ListTutorials.astro b/src/components/ListTutorials.astro index 61497b225acf381..b1d4f75a442ebb7 100644 --- a/src/components/ListTutorials.astro +++ b/src/components/ListTutorials.astro @@ -1,7 +1,15 @@ --- -import { getCollection, getEntry, type InferEntrySchema } from "astro:content"; +import { getCollection, getEntry, type CollectionEntry } from "astro:content"; import { formatDistance } from "date-fns"; +import { process } from "~/util/rehype"; +import rehypeExternalLinks from "~/plugins/rehype/external-links"; + +type DocsEntry = CollectionEntry<"docs">; +type VideoEntry = CollectionEntry<"videos">; + +const tutorials: Array = []; + const currentSection = Astro.params.slug?.split("/")[0]; const currentProduct = await getEntry("products", currentSection!); @@ -13,7 +21,7 @@ if (!currentProduct) { const productTitle = currentProduct.data.product.title; -const tutorials = await getCollection("docs", (entry) => { +const docs = await getCollection("docs", (entry) => { return ( // pcx_content_type: tutorial entry.data.pcx_content_type === "tutorial" && @@ -26,47 +34,17 @@ const tutorials = await getCollection("docs", (entry) => { ); }); -type VideoEntry = InferEntrySchema<"videos">["entries"][number]; - -type FinalTutorials = { - slug?: string; - data: - | ({ type: "docs" } & InferEntrySchema<"docs">) - | ({ type: "videos" } & VideoEntry); -}[]; - -const finalTutorials: FinalTutorials = tutorials.map((x) => ({ - slug: x.id, - data: { - type: "docs", - ...x.data, - }, -})); - -const videos = await getEntry("videos", "index"); - -if (!videos) { - throw new Error("Failed to load data"); -} +tutorials.push(...docs); -const filteredVideos = videos.data.entries.filter((x) => - x.products.some( +const videos = await getCollection("videos", (entry) => { + return entry.data.products.some( (v: string) => v.toUpperCase() === productTitle.toUpperCase(), - ), -); - -if (filteredVideos) { - filteredVideos.forEach((x) => - finalTutorials.push({ - data: { - type: "videos", - ...x, - }, - }), ); -} +}); + +tutorials.push(...videos); -finalTutorials.sort((a, b) => Number(b.data.updated) - Number(a.data.updated)); +tutorials.sort((a, b) => Number(b.data.updated) - Number(a.data.updated)); const timeAgo = (date?: Date) => { if (!date) return undefined; @@ -85,15 +63,23 @@ const timeAgo = (date?: Date) => { { - finalTutorials.map((tutorial) => { + tutorials.map(async (tutorial) => { + const title = + tutorial.collection === "docs" ? tutorial.data.title : tutorial.id; + const href = - tutorial.data.type === "docs" - ? `/${tutorial.slug}/` + tutorial.collection === "docs" + ? `/${tutorial.id}/` : tutorial.data.link; + + const anchor = await process(`${title}`, [ + rehypeExternalLinks, + ]); + return ( - {tutorial.data.title} + {timeAgo(tutorial.data.updated)} {tutorial.data.content_type} diff --git a/src/content.config.ts b/src/content.config.ts index 5f8f1f01d0f4bb2..c472e1bfeab71f7 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -3,7 +3,7 @@ import { z, defineCollection } from "astro:content"; import { docsLoader, i18nLoader } from "@astrojs/starlight/loaders"; import { docsSchema, i18nSchema } from "@astrojs/starlight/schema"; -import { glob } from "astro/loaders"; +import { glob, file } from "astro/loaders"; import { appsSchema, @@ -95,11 +95,11 @@ export const collections = { schema: workersAiModelsSchema, }), videos: defineCollection({ - loader: dataLoader("videos"), + loader: file("src/content/videos/index.yaml"), schema: videosSchema, }), apps: defineCollection({ - loader: dataLoader("apps"), + loader: file("src/content/apps/index.yaml"), schema: appsSchema, }), "warp-releases": defineCollection({ diff --git a/src/content/apps/index.yaml b/src/content/apps/index.yaml index d2b31c02269c814..a83364c7e157f01 100644 --- a/src/content/apps/index.yaml +++ b/src/content/apps/index.yaml @@ -1,343 +1,342 @@ -entries: - - link: https://github.com/craigsdennis/phoney-ai - name: Phoney AI - description: This application uses Cloudflare Workers AI, Twilio, and AssemblyAI. Your phone is an input and output device. - tags: [AI, Twilio, Hono] - products: [Workers AI, Workers] - languages: [JavaScript] - cloudflare: true - author: craig - updated: 2024-03-01 - - link: https://github.com/craigsdennis/image-model-streamlit-workers-ai - name: Image Model Streamlit starters - description: Collection of Streamlit applications that are making use of Cloudflare Workers AI. - tags: [AI, Streamlit] - products: [Workers AI] - languages: [Python] - author: craig - cloudflare: true - updated: 2024-03-01 - - link: https://github.com/craigsdennis/vanilla-chat-workers-ai - name: Vanilla JavaScript Chat Application using Cloudflare Workers AI - description: A web based chat interface built on Cloudflare Pages that allows for exploring Text Generation models on Cloudflare Workers AI. Design is built using tailwind. - tags: [AI, Tailwind, Hono] - products: [Workers AI, Pages, Workers] - languages: [TypeScript] - author: craig - cloudflare: true - updated: 2024-03-01 - - link: https://github.com/craigsdennis/whatever-ify-workers-ai - name: Whatever-ify - description: Turn yourself into...whatever. Take a photo, get a description, generate a scene and character, then generate an image based on that calendar. - tags: [AI, Hono] - products: [Workers AI, Pages, Workers] - languages: [TypeScript] - author: craig - cloudflare: true - updated: 2024-04-01 - - link: https://github.com/craigsdennis/comically-bad-art-workers-ai-streamlit - name: Comically Bad Art Generation - description: This app uses the wonderful Python UI Framework Streamlit and Cloudflare Workers AI. - tags: [AI, Streamlit] - products: [Workers AI] - languages: [Python] - author: craig - cloudflare: true - updated: 2024-05-01 - - link: https://github.com/craigsdennis/floor-is-llava-workers-ai - name: Floor is Llava - description: This is an example repo to explore using the AI Vision model Llava hosted on Cloudflare Workers AI. This is a SvelteKit app hosted on Pages. - tags: [AI, SvelteKit] - products: [Workers AI, Pages, Workers] - languages: [TypeScript] - cloudflare: true - updated: 2024-05-23 - - link: https://github.com/craigsdennis/hackathon-helper-workers-ai - name: Hackathon Helper - description: A series of starters for Hackathons. Get building quicker! Python, Streamlit, Workers, and Pages starters for all your AI needs! - tags: [AI, Streamlit, Hono] - products: [Workers, Workers AI, Pages] - languages: [JavaScript, Python] - cloudflare: true - updated: 2024-06-12 - - link: https://github.com/craigsdennis/lightbulb-moment-tool-calling - name: Homie - Home Automation using Function Calling - description: A home automation tool that uses AI Function calling to change the color of lightbulbs in your home. - tags: [AI, Hono] - products: [Workers AI, Workers] - languages: [TypeScript] - cloudflare: true - updated: 2024-06-17 - - link: https://github.com/craigsdennis/shorty-dot-dev - name: shrty.dev - description: A URL shortener that makes use of KV and Workers Analytics Engine. The admin interface uses Function Calling. Go Shorty! - tags: [AI, Hono] - products: [Workers AI, KV, Workers] - languages: [TypeScript] - cloudflare: true - updated: 2024-07-02 - - link: https://github.com/elizabethsiegle/cfworkers-ai-translate - name: Multimodal AI Translator - description: This application uses Cloudflare Workers AI to perform multimodal translation of languages via audio and text in the browser. - tags: [AI] - products: [Workers, Workers AI] - languages: [JavaScript] - author: lizzie - cloudflare: true - updated: 2024-05-28 - - link: https://github.com/elizabethsiegle/cf-ai-lora-news-summarizer - name: LoRA News Summarizer - description: This application uses Cloudflare Workers AI, Streamlit, and Beautiful Soup to summarize input news article URLs in a variety of tones. - tags: [AI, Streamlit] - products: [Workers AI] - languages: [Python] - author: lizzie - cloudflare: true - updated: 2024-07-08 - - link: https://github.com/elizabethsiegle/nbafinals-cloudflare-ai-hono-durable-objects - name: NBA Finals Polling and Predictor - description: This stateful polling application uses Cloudflare Workers AI, Cloudflare Pages, Cloudflare Durable Objects, and Hono to keep track of users' votes for different basketball teams and generates personal predictions for the series. - tags: [AI, Hono] - products: [Workers AI, Pages, Durable Objects] - languages: [TypeScript] - author: lizzie - cloudflare: true - updated: 2024-06-06 - - link: https://github.com/elizabethsiegle/cf-workers-ai-obj-detection-webcam - name: Workers AI Object Detector - description: Detect objects from a webcam in a Cloudflare Worker web app with detr-resnet-50 hosted on Cloudflare using Cloudflare Workers AI. - tags: [AI] - products: [Workers, Workers AI] - languages: [JavaScript] - author: lizzie - cloudflare: true - updated: 2024-05-23 - - link: https://github.com/elizabethsiegle/star-wars-fanfic-generator-streamlit-astra-cf - name: Fanfic Generator - description: This application uses Cloudflare Workers AI, Streamlit, and AstraDB to generate personal scifi fanfiction. - tags: [AI, Streamlit, AstraDB] - products: [Workers AI] - languages: [Python] - author: lizzie - cloudflare: true - updated: 2024-06-29 - - link: https://github.com/harshil1712/nextjs-r2-demo - name: Upload Image to R2 starter - description: Upload images to Cloudflare R2 from a Next.js application. - tags: [NextJS] - products: [R2, Pages] - languages: [TypeScript] - author: harshil - cloudflare: true - updated: 2024-06-21 - - link: https://github.com/harshil1712/remix-d1-auth-template - name: Remix Authentication Starter - description: Implement authenticating to a Remix app and store user data in Cloudflare D1. - tags: [Remix] - products: [D1] - languages: [TypeScript] - author: harshil - cloudflare: true - updated: 2024-07-09 - - link: https://github.com/cloudflare/turnstile-demo-workers - name: Turnstile Demo - description: A simple demo with a Turnstile-protected form, using Cloudflare Workers. With the code in this repository, we demonstrate implicit rendering and explicit rendering. - tags: [] - products: [Turnstile, Workers] - languages: [JavaScript] - cloudflare: true - updated: 2024-02-15 - - link: https://github.com/cloudflare/doom-workers - name: Multiplayer Doom Workers - description: A WebAssembly Doom port with multiplayer support running on top of Cloudflare's global network using Workers, WebSockets, Pages, and Durable Objects. - tags: [WebSockets] - products: [Pages, Durable Objects, Workers] - languages: [JavaScript] - cloudflare: true - updated: 2023-06-15 - - link: https://github.com/cloudflare/hyperdrive-demo - name: Hyperdrive demo - description: A Remix app that connects to a database behind Cloudflare's Hyperdrive, making regional databases feel like they're globally distributed. - tags: [Remix] - products: [Hyperdrive] - languages: [TypeScript] - cloudflare: true - updated: 2024-04-04 - - link: https://github.com/cloudflare/d1-northwind - name: D1 Northwind Demo - description: This is a demo of the Northwind dataset, running on Cloudflare Workers, and D1 - Cloudflare's SQL database, running on SQLite. - tags: [Tailwind, React, Remix] - products: [Workers, D1] - languages: [TypeScript, SQL] - cloudflare: true - updated: 2023-07-12 - - link: https://github.com/cloudflare/workers-chat-demo - name: Cloudflare Workers Chat Demo - description: This is a demo app written on Cloudflare Workers utilizing Durable Objects to implement real-time chat with stored history. - tags: [WebSockets] - products: [Workers, Durable Objects] - languages: [JavaScript] - cloudflare: true - updated: 2024-03-05 - - link: https://github.com/cloudflare/js-rpc-and-entrypoints-demo - name: JavaScript-native RPC on Cloudflare Workers <> Named Entrypoints - description: This is a collection of examples of communicating between multiple Cloudflare Workers using the remote-procedure call (RPC) system that is built into the Workers runtime. - tags: [RPC, Discord] - products: [Workers, D1, Access] - languages: [TypeScript] - cloudflare: true - updated: 2024-04-16 - - link: https://github.com/harshil1712/jobs-at-conf-demo - name: Jobs At Conf - description: A job lisiting website to add jobs you find at in-person conferences. Built with Cloudflare Pages, R2, D1, Queues, and Workers AI. - tags: [Next.js] - products: [D1, R2, Workers AI, Queues, Pages] - languages: [TypeScript] - author: harshil - cloudflare: true - updated: 2024-07-29 - - link: https://github.com/cloudflare/queues-web-crawler - name: Queues Web Crawler - description: An example use-case for Queues, a web crawler built on Browser Rendering and Puppeteer. The crawler finds the number of links to Cloudflare.com on the site, and archives a screenshot to Workers KV. - tags: [] - products: [KV, Browser Rendering, Workers, Pages, Queues] - languages: [TypeScript] - cloudflare: true - updated: 2023-06-15 - - link: https://github.com/cloudflare/workers-for-platforms-example - name: Workers for Platforms Example Project - description: Explore how you could manage thousands of Workers with a single Cloudflare Workers account. - tags: [Hono] - products: [D1, Workers, Workers for Platforms] - languages: [TypeScript] - cloudflare: true - updated: 2024-04-03 - - link: https://github.com/cloudflare/dmarc-email-worker - name: DMARC Email Worker - description: A Cloudflare worker script to process incoming DMARC reports, store them, and produce analytics. - tags: [] - products: [R2, Workers, Email Workers] - languages: [TypeScript] - cloudflare: true - updated: 2023-03-17 - - link: https://github.com/cloudflare/pages-fns-with-wasm-demo - name: Pages Functions with WebAssembly - description: This is a demo application that exemplifies the use of Wasm module imports inside Pages Functions code. - tags: [] - products: [Pages] - languages: [Rust] - cloudflare: true - updated: 2023-03-22 - - link: https://github.com/cloudflare/orange - name: Orange Meets - description: Orange Meets is a demo WebRTC application built using Cloudflare Calls. - tags: [] - products: [Calls] - languages: [TypeScript] - cloudflare: true - updated: 2024-07-05 - - link: https://github.com/cloudflare/calls-examples/tree/main/whip-whep-server - name: WHIP-WHEP Server - description: WHIP and WHEP server implemented on top of Calls API. - tags: [] - products: [Calls] - languages: [TypeScript] - cloudflare: true - updated: 2022-06-12 - - link: https://github.com/cloudflare/calls-examples/tree/main/echo - name: Calls Echo Demo - description: Demonstrates a local stream alongside a remote echo stream. - tags: [] - products: [Calls] - languages: [JavaScript] - cloudflare: true - updated: 2025-05-10 - - link: https://github.com/cloudflare/calls-examples/tree/main/echo-datachannels - name: Calls DataChannel Test - description: This example establishes two datachannels, one publishes data and the other one subscribes, the test measures how fast a message travels to and from the server. - tags: [] - products: [Calls] - languages: [JavaScript] - cloudflare: true - updated: 2022-06-04 - - link: https://github.com/cloudflare/wildebeest - name: Wildebeest - description: Wildebeest is an ActivityPub and Mastodon-compatible server whose goal is to allow anyone to operate their Fediverse server and identity on their domain without needing to keep infrastructure, with minimal setup and maintenance, and running in minutes. - tags: [] - products: [Workers, Pages, Durable Objects, Queues, D1, Access, Images] - languages: [TypeScript] - cloudflare: true - updated: 2023-07-31 - - link: https://github.com/cloudflare/workers-access-external-auth-example - name: Access External Auth Rule Example Worker - description: This is a worker that allows you to quickly setup an external evalutation rule in Cloudflare Access. - tags: [] - products: [Workers, Access] - languages: [JavaScript] - cloudflare: true - updated: 2022-08-01 - - link: https://github.com/lauragift21/staff-directory - name: Staff Directory demo - description: Built using the powerful combination of HonoX for backend logic, Cloudflare Pages for fast and secure hosting, and Cloudflare D1 for seamless database management. - tags: [Hono] - products: [Pages, D1] - languages: [TypeScript] - author: gift - cloudflare: true - updated: 2024-03-18 - - link: https://github.com/atinux/atidraw - name: Atidraw - description: A web application made with Nuxt that lets you to create, enhance, and share your drawings with the world. Harnessing the power of Cloudflare R2 and Cloudflare AI to store and enhance your drawings. - tags: [Nuxt] - products: [Pages, R2, Workers AI] - languages: [TypeScript] - cloudflare: false - updated: 2024-08-12 - - link: https://github.com/atinux/atidone - name: Atidone - description: A full-stack application made with Nuxt, Cloudflare D1 and Authentication to store your todos on the web. - tags: [Nuxt] - products: [Pages, D1] - languages: [TypeScript] - cloudflare: false - updated: 2024-08-12 - - link: https://github.com/atinux/atinotes - name: Atinotes - description: Store Markdown notes in Cloudflare KV with this full-stack application made with Nuxt & deployed on Cloudflare Pages. - tags: [Nuxt] - products: [Pages, KV] - languages: [TypeScript] - cloudflare: false - updated: 2024-08-12 - - link: https://github.com/Flosciante/nuxt-image-gallery - name: Nuxt Image Gallery - description: A web application to create an image gallery with Cloudflare R2 with a built-in image editor. - tags: [Nuxt] - products: [Pages, R2] - languages: [TypeScript] - cloudflare: false - updated: 2024-08-29 - - link: https://github.com/ra-jeev/hub-chat - name: AI Chat - description: A full-stack application made with Nuxt to chat with various Cloudflare Workers AI LLM. - tags: [Nuxt] - products: [Pages, Workers AI] - languages: [TypeScript] - cloudflare: false - updated: 2024-08-29 - - link: https://github.com/craigsdennis/gamertown-workers-ai-vectorize - name: Gamertown Customer Support Assistant - description: A RAG based AI Chat app that uses Vectorize to access video game data for employees of Gamertown. - tags: [AI, Hono, Vectorize] - products: [Workers, Workers AI, Vectorize] - languages: [TypeScript] - cloudflare: true - updated: 2024-09-12 - - link: https://github.com/atinux/flux-ai-image-generator - name: Flux Schnell Image Generator - description: An application to generate images with AI using Flux-1 Schnell and store them in Cloudflare R2. - tags: [Nuxt] - products: [Pages, Workers AI, R2] - languages: [TypeScript] - cloudflare: false - updated: 2024-10-07 +- link: https://github.com/craigsdennis/phoney-ai + id: Phoney AI + description: This application uses Cloudflare Workers AI, Twilio, and AssemblyAI. Your phone is an input and output device. + tags: [AI, Twilio, Hono] + products: [Workers AI, Workers] + languages: [JavaScript] + cloudflare: true + author: craig + updated: 2024-03-01 +- link: https://github.com/craigsdennis/image-model-streamlit-workers-ai + id: Image Model Streamlit starters + description: Collection of Streamlit applications that are making use of Cloudflare Workers AI. + tags: [AI, Streamlit] + products: [Workers AI] + languages: [Python] + author: craig + cloudflare: true + updated: 2024-03-01 +- link: https://github.com/craigsdennis/vanilla-chat-workers-ai + id: Vanilla JavaScript Chat Application using Cloudflare Workers AI + description: A web based chat interface built on Cloudflare Pages that allows for exploring Text Generation models on Cloudflare Workers AI. Design is built using tailwind. + tags: [AI, Tailwind, Hono] + products: [Workers AI, Pages, Workers] + languages: [TypeScript] + author: craig + cloudflare: true + updated: 2024-03-01 +- link: https://github.com/craigsdennis/whatever-ify-workers-ai + id: Whatever-ify + description: Turn yourself into...whatever. Take a photo, get a description, generate a scene and character, then generate an image based on that calendar. + tags: [AI, Hono] + products: [Workers AI, Pages, Workers] + languages: [TypeScript] + author: craig + cloudflare: true + updated: 2024-04-01 +- link: https://github.com/craigsdennis/comically-bad-art-workers-ai-streamlit + id: Comically Bad Art Generation + description: This app uses the wonderful Python UI Framework Streamlit and Cloudflare Workers AI. + tags: [AI, Streamlit] + products: [Workers AI] + languages: [Python] + author: craig + cloudflare: true + updated: 2024-05-01 +- link: https://github.com/craigsdennis/floor-is-llava-workers-ai + id: Floor is Llava + description: This is an example repo to explore using the AI Vision model Llava hosted on Cloudflare Workers AI. This is a SvelteKit app hosted on Pages. + tags: [AI, SvelteKit] + products: [Workers AI, Pages, Workers] + languages: [TypeScript] + cloudflare: true + updated: 2024-05-23 +- link: https://github.com/craigsdennis/hackathon-helper-workers-ai + id: Hackathon Helper + description: A series of starters for Hackathons. Get building quicker! Python, Streamlit, Workers, and Pages starters for all your AI needs! + tags: [AI, Streamlit, Hono] + products: [Workers, Workers AI, Pages] + languages: [JavaScript, Python] + cloudflare: true + updated: 2024-06-12 +- link: https://github.com/craigsdennis/lightbulb-moment-tool-calling + id: Homie - Home Automation using Function Calling + description: A home automation tool that uses AI Function calling to change the color of lightbulbs in your home. + tags: [AI, Hono] + products: [Workers AI, Workers] + languages: [TypeScript] + cloudflare: true + updated: 2024-06-17 +- link: https://github.com/craigsdennis/shorty-dot-dev + id: shrty.dev + description: A URL shortener that makes use of KV and Workers Analytics Engine. The admin interface uses Function Calling. Go Shorty! + tags: [AI, Hono] + products: [Workers AI, KV, Workers] + languages: [TypeScript] + cloudflare: true + updated: 2024-07-02 +- link: https://github.com/elizabethsiegle/cfworkers-ai-translate + id: Multimodal AI Translator + description: This application uses Cloudflare Workers AI to perform multimodal translation of languages via audio and text in the browser. + tags: [AI] + products: [Workers, Workers AI] + languages: [JavaScript] + author: lizzie + cloudflare: true + updated: 2024-05-28 +- link: https://github.com/elizabethsiegle/cf-ai-lora-news-summarizer + id: LoRA News Summarizer + description: This application uses Cloudflare Workers AI, Streamlit, and Beautiful Soup to summarize input news article URLs in a variety of tones. + tags: [AI, Streamlit] + products: [Workers AI] + languages: [Python] + author: lizzie + cloudflare: true + updated: 2024-07-08 +- link: https://github.com/elizabethsiegle/nbafinals-cloudflare-ai-hono-durable-objects + id: NBA Finals Polling and Predictor + description: This stateful polling application uses Cloudflare Workers AI, Cloudflare Pages, Cloudflare Durable Objects, and Hono to keep track of users' votes for different basketball teams and generates personal predictions for the series. + tags: [AI, Hono] + products: [Workers AI, Pages, Durable Objects] + languages: [TypeScript] + author: lizzie + cloudflare: true + updated: 2024-06-06 +- link: https://github.com/elizabethsiegle/cf-workers-ai-obj-detection-webcam + id: Workers AI Object Detector + description: Detect objects from a webcam in a Cloudflare Worker web app with detr-resnet-50 hosted on Cloudflare using Cloudflare Workers AI. + tags: [AI] + products: [Workers, Workers AI] + languages: [JavaScript] + author: lizzie + cloudflare: true + updated: 2024-05-23 +- link: https://github.com/elizabethsiegle/star-wars-fanfic-generator-streamlit-astra-cf + id: Fanfic Generator + description: This application uses Cloudflare Workers AI, Streamlit, and AstraDB to generate personal scifi fanfiction. + tags: [AI, Streamlit, AstraDB] + products: [Workers AI] + languages: [Python] + author: lizzie + cloudflare: true + updated: 2024-06-29 +- link: https://github.com/harshil1712/nextjs-r2-demo + id: Upload Image to R2 starter + description: Upload images to Cloudflare R2 from a Next.js application. + tags: [NextJS] + products: [R2, Pages] + languages: [TypeScript] + author: harshil + cloudflare: true + updated: 2024-06-21 +- link: https://github.com/harshil1712/remix-d1-auth-template + id: Remix Authentication Starter + description: Implement authenticating to a Remix app and store user data in Cloudflare D1. + tags: [Remix] + products: [D1] + languages: [TypeScript] + author: harshil + cloudflare: true + updated: 2024-07-09 +- link: https://github.com/cloudflare/turnstile-demo-workers + id: Turnstile Demo + description: A simple demo with a Turnstile-protected form, using Cloudflare Workers. With the code in this repository, we demonstrate implicit rendering and explicit rendering. + tags: [] + products: [Turnstile, Workers] + languages: [JavaScript] + cloudflare: true + updated: 2024-02-15 +- link: https://github.com/cloudflare/doom-workers + id: Multiplayer Doom Workers + description: A WebAssembly Doom port with multiplayer support running on top of Cloudflare's global network using Workers, WebSockets, Pages, and Durable Objects. + tags: [WebSockets] + products: [Pages, Durable Objects, Workers] + languages: [JavaScript] + cloudflare: true + updated: 2023-06-15 +- link: https://github.com/cloudflare/hyperdrive-demo + id: Hyperdrive demo + description: A Remix app that connects to a database behind Cloudflare's Hyperdrive, making regional databases feel like they're globally distributed. + tags: [Remix] + products: [Hyperdrive] + languages: [TypeScript] + cloudflare: true + updated: 2024-04-04 +- link: https://github.com/cloudflare/d1-northwind + id: D1 Northwind Demo + description: This is a demo of the Northwind dataset, running on Cloudflare Workers, and D1 - Cloudflare's SQL database, running on SQLite. + tags: [Tailwind, React, Remix] + products: [Workers, D1] + languages: [TypeScript, SQL] + cloudflare: true + updated: 2023-07-12 +- link: https://github.com/cloudflare/workers-chat-demo + id: Cloudflare Workers Chat Demo + description: This is a demo app written on Cloudflare Workers utilizing Durable Objects to implement real-time chat with stored history. + tags: [WebSockets] + products: [Workers, Durable Objects] + languages: [JavaScript] + cloudflare: true + updated: 2024-03-05 +- link: https://github.com/cloudflare/js-rpc-and-entrypoints-demo + id: JavaScript-native RPC on Cloudflare Workers <> Named Entrypoints + description: This is a collection of examples of communicating between multiple Cloudflare Workers using the remote-procedure call (RPC) system that is built into the Workers runtime. + tags: [RPC, Discord] + products: [Workers, D1, Access] + languages: [TypeScript] + cloudflare: true + updated: 2024-04-16 +- link: https://github.com/harshil1712/jobs-at-conf-demo + id: Jobs At Conf + description: A job lisiting website to add jobs you find at in-person conferences. Built with Cloudflare Pages, R2, D1, Queues, and Workers AI. + tags: [Next.js] + products: [D1, R2, Workers AI, Queues, Pages] + languages: [TypeScript] + author: harshil + cloudflare: true + updated: 2024-07-29 +- link: https://github.com/cloudflare/queues-web-crawler + id: Queues Web Crawler + description: An example use-case for Queues, a web crawler built on Browser Rendering and Puppeteer. The crawler finds the number of links to Cloudflare.com on the site, and archives a screenshot to Workers KV. + tags: [] + products: [KV, Browser Rendering, Workers, Pages, Queues] + languages: [TypeScript] + cloudflare: true + updated: 2023-06-15 +- link: https://github.com/cloudflare/workers-for-platforms-example + id: Workers for Platforms Example Project + description: Explore how you could manage thousands of Workers with a single Cloudflare Workers account. + tags: [Hono] + products: [D1, Workers, Workers for Platforms] + languages: [TypeScript] + cloudflare: true + updated: 2024-04-03 +- link: https://github.com/cloudflare/dmarc-email-worker + id: DMARC Email Worker + description: A Cloudflare worker script to process incoming DMARC reports, store them, and produce analytics. + tags: [] + products: [R2, Workers, Email Workers] + languages: [TypeScript] + cloudflare: true + updated: 2023-03-17 +- link: https://github.com/cloudflare/pages-fns-with-wasm-demo + id: Pages Functions with WebAssembly + description: This is a demo application that exemplifies the use of Wasm module imports inside Pages Functions code. + tags: [] + products: [Pages] + languages: [Rust] + cloudflare: true + updated: 2023-03-22 +- link: https://github.com/cloudflare/orange + id: Orange Meets + description: Orange Meets is a demo WebRTC application built using Cloudflare Calls. + tags: [] + products: [Calls] + languages: [TypeScript] + cloudflare: true + updated: 2024-07-05 +- link: https://github.com/cloudflare/calls-examples/tree/main/whip-whep-server + id: WHIP-WHEP Server + description: WHIP and WHEP server implemented on top of Calls API. + tags: [] + products: [Calls] + languages: [TypeScript] + cloudflare: true + updated: 2022-06-12 +- link: https://github.com/cloudflare/calls-examples/tree/main/echo + id: Calls Echo Demo + description: Demonstrates a local stream alongside a remote echo stream. + tags: [] + products: [Calls] + languages: [JavaScript] + cloudflare: true + updated: 2025-05-10 +- link: https://github.com/cloudflare/calls-examples/tree/main/echo-datachannels + id: Calls DataChannel Test + description: This example establishes two datachannels, one publishes data and the other one subscribes, the test measures how fast a message travels to and from the server. + tags: [] + products: [Calls] + languages: [JavaScript] + cloudflare: true + updated: 2022-06-04 +- link: https://github.com/cloudflare/wildebeest + id: Wildebeest + description: Wildebeest is an ActivityPub and Mastodon-compatible server whose goal is to allow anyone to operate their Fediverse server and identity on their domain without needing to keep infrastructure, with minimal setup and maintenance, and running in minutes. + tags: [] + products: [Workers, Pages, Durable Objects, Queues, D1, Access, Images] + languages: [TypeScript] + cloudflare: true + updated: 2023-07-31 +- link: https://github.com/cloudflare/workers-access-external-auth-example + id: Access External Auth Rule Example Worker + description: This is a worker that allows you to quickly setup an external evalutation rule in Cloudflare Access. + tags: [] + products: [Workers, Access] + languages: [JavaScript] + cloudflare: true + updated: 2022-08-01 +- link: https://github.com/lauragift21/staff-directory + id: Staff Directory demo + description: Built using the powerful combination of HonoX for backend logic, Cloudflare Pages for fast and secure hosting, and Cloudflare D1 for seamless database management. + tags: [Hono] + products: [Pages, D1] + languages: [TypeScript] + author: gift + cloudflare: true + updated: 2024-03-18 +- link: https://github.com/atinux/atidraw + id: Atidraw + description: A web application made with Nuxt that lets you to create, enhance, and share your drawings with the world. Harnessing the power of Cloudflare R2 and Cloudflare AI to store and enhance your drawings. + tags: [Nuxt] + products: [Pages, R2, Workers AI] + languages: [TypeScript] + cloudflare: false + updated: 2024-08-12 +- link: https://github.com/atinux/atidone + id: Atidone + description: A full-stack application made with Nuxt, Cloudflare D1 and Authentication to store your todos on the web. + tags: [Nuxt] + products: [Pages, D1] + languages: [TypeScript] + cloudflare: false + updated: 2024-08-12 +- link: https://github.com/atinux/atinotes + id: Atinotes + description: Store Markdown notes in Cloudflare KV with this full-stack application made with Nuxt & deployed on Cloudflare Pages. + tags: [Nuxt] + products: [Pages, KV] + languages: [TypeScript] + cloudflare: false + updated: 2024-08-12 +- link: https://github.com/Flosciante/nuxt-image-gallery + id: Nuxt Image Gallery + description: A web application to create an image gallery with Cloudflare R2 with a built-in image editor. + tags: [Nuxt] + products: [Pages, R2] + languages: [TypeScript] + cloudflare: false + updated: 2024-08-29 +- link: https://github.com/ra-jeev/hub-chat + id: AI Chat + description: A full-stack application made with Nuxt to chat with various Cloudflare Workers AI LLM. + tags: [Nuxt] + products: [Pages, Workers AI] + languages: [TypeScript] + cloudflare: false + updated: 2024-08-29 +- link: https://github.com/craigsdennis/gamertown-workers-ai-vectorize + id: Gamertown Customer Support Assistant + description: A RAG based AI Chat app that uses Vectorize to access video game data for employees of Gamertown. + tags: [AI, Hono, Vectorize] + products: [Workers, Workers AI, Vectorize] + languages: [TypeScript] + cloudflare: true + updated: 2024-09-12 +- link: https://github.com/atinux/flux-ai-image-generator + id: Flux Schnell Image Generator + description: An application to generate images with AI using Flux-1 Schnell and store them in Cloudflare R2. + tags: [Nuxt] + products: [Pages, Workers AI, R2] + languages: [TypeScript] + cloudflare: false + updated: 2024-10-07 diff --git a/src/content/videos/index.yaml b/src/content/videos/index.yaml index 7617be9dab20890..92070f9b5fe7d2a 100644 --- a/src/content/videos/index.yaml +++ b/src/content/videos/index.yaml @@ -1,421 +1,420 @@ -entries: - - link: https://www.youtube.com/watch?v=Id5oKCa__IA - title: Tool Calling Also Known as Function Calling on Cloudflare Workers AI - description: Tool calling, also known as function calling, is a powerful concept that lets you build Large Language Model based applications that can perform actions and retrieve external information from defined tools. - tags: [AI] - languages: [TypeScript] - products: [Workers AI] - cloudflare: true - stream_id: 603e94c9803b4779dd612493c0dd7125 - author: craig - updated: 2024-06-20 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=MlV9Kvkh9hw - title: Build a URL Shortener with an AI-based admin section - description: We are building a URL Shortener, shrty.dev, on Cloudflare. The apps uses Workers KV and Workers Analytics engine. Craig decided to build with Workers AI runWithTools to provide a chat interface for admins. - tags: [Workers Analytics Engine, AI] - products: [Workers AI, KV] - languages: [TypeScript] - cloudflare: true - author: craig - updated: 2024-07-01 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=dttu4QtKkO0 - title: Build Rust Powered Apps - description: In this video, we will show you how to build a global database using workers-rs to keep track of every country and city you’ve visited. - tags: [] - languages: [Rust] - products: [Workers, KV] - cloudflare: true - author: confidence - updated: 2024-06-25 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=GRpwVMkVmKo - title: API Roll (Father's Day) - description: This walks through how to use Workers AI with Hono and Zod to create a streaming pun generating API. - tags: [AI, Hono] - languages: [TypeScript] - products: [Workers AI] - cloudflare: true - author: craig - updated: 2024-06-15 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=MLbo7MGY_lU - title: AI can see clearly now - Build Vision Apps on Cloudflare Workers AI - description: The LlaVa model is hosted on Cloudflare Workers AI. Which means you are an API call away from brand new powerful vision use cases in all of your applications. - tags: [AI] - languages: [TypeScript] - products: [Workers AI] - cloudflare: true - author: craig - updated: 2024-06-11 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=QTsaAhFvX9o - title: Stateful Apps with Cloudflare Workers - description: Learn how to access external APIs, cache and retrieve data using Workers KV, and create SQL-driven applications with Cloudflare D1. - tags: [] - languages: [TypeScript, SQL] - products: [Workers, KV, D1] - cloudflare: true - author: kristian - updated: 2024-05-22 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=5UTExUQ8Fwo - title: Workers AI - Getting Started - Vanilla Chat App - description: Get started building AI apps on Cloudflare using Pages and the GitHub starter template for a Vanilla JavaScript Chat App. - tags: [AI] - languages: [TypeScript] - products: [Workers AI] - cloudflare: true - author: craig - updated: 2024-04-17 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=H7Qe96fqg1M - title: Learn Cloudflare Workers - Full Course for Beginners - description: Learn how to build your first Cloudflare Workers application and deploy it to Cloudflare's global network. - tags: [] - products: [Workers] - languages: [TypeScript] - cloudflare: true - author: kristian - updated: 2024-03-12 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=8SnrvAYAJ4Q - title: Image Generation, Inpainting, and Vision Models - description: Is that person you are about to swipe right on, actually real? Are they AI Generated? - tags: [AI] - products: [Workers AI] - languages: [Python] - cloudflare: true - author: craig - updated: 2024-03-08 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=9JM5Z0KzQsQ - title: Learn AI Development (models, embeddings, vectors) - description: In this workshop, Kristian Freeman, Cloudflare Developer Advocate, teaches the basics of AI Development - models, embeddings, and vectors (including vector databases). - tags: [AI] - products: [Workers AI, Workers, Vectorize] - cloudflare: true - author: kristian - updated: 2023-12-14 - difficulty: Advanced - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=idKdjA8t0jw - title: Optimize your AI App & fine-tune models (AI Gateway, R2) - description: In this workshop, Kristian Freeman, Cloudflare Developer Advocate, shows how to optimize your existing AI applications with Cloudflare AI Gateway, and how to finetune OpenAI models using R2. - tags: [AI] - products: [Workers, R2, AI Gateway] - languages: [JavaScript] - cloudflare: true - author: kristian - updated: 2023-12-14 - difficulty: Advanced - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://www.youtube.com/watch?v=CHfKeFakGAI - title: How to use Cloudflare AI models and inference in Python with Jupyter Notebooks - description: Cloudflare Workers AI provides a ton of AI models and inference capabilities. In this video, we will explore how to make use of Cloudflare’s AI model catalog using a Python Jupyter Notebook. - tags: [AI] - languages: [Python] - products: [Workers, AI Gateway] - cloudflare: true - author: craig - updated: 2023-12-14 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/cK_leoJsBWY - title: Cloudflare Workers AI, Building a "Hello, World" AI App! - description: Cloudflare's Workers AI helps you add AI functionality to the apps you are building. In this video we show you how simple and straightforward it is to build the Hello World of AI apps in under 5 minutes. - tags: [Workers, AI] - languages: [TypeScript] - products: [Workers AI] - cloudflare: true - stream_id: 0b251ede0256f04f24f9127587e0c3aa - author: craig - updated: 2024-09-11 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/9IjfyBJsJRQ - title: Use Vectorize to add additional context to your AI Applications through RAG - description: A RAG based AI Chat app that uses Vectorize to access video game data for employees of Gamertown. - tags: [Workers, AI, Vectorize, RAG, Hono] - languages: [TypeScript] - products: [Workers, Workers AI, Vectorize] - cloudflare: true - # stream_id: 0b251ede0256f04f24f9127587e0c3aa - author: craig - updated: 2024-09-12 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/doKt9wWQF9A - title: AI meets Maps | Using Cloudflare AI, Langchain, Mapbox, Folium and Streamlit - description: Welcome to RouteMe, a smart tool that helps you plan the most efficient route between landmarks in any city. Powered by Cloudflare Workers AI, Langchain and Mapbox. This Streamlit webapp uses LLMs and Mapbox off my scripts API to solve the classic traveling salesman problem, turning your sightseeing into an optimized adventure! - tags: [Workers, Workers AI] - languages: [Python] - products: [Workers, Workers AI] - cloudflare: true - stream_id: f610dee9aa20ec843b0e451b3014540a - author: lizzie - updated: 2024-09-16 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/bwJkwD-F0kQ - title: Welcome to the Cloudflare Developer Channel - description: Welcome to the Cloudflare Developers YouTube channel. We've got tutorials and working demos and everything you need to level up your projects. Whether you're working on your next big thing or just dorking around with some side projects, we've got you covered! So why don't you come hang out, subscribe to our developer channel and together we'll build something awesome. You're gonna love it. - tags: [Workers, AI, Vectorize, RAG, Hono, D1, R2, AI Gateway] - languages: [TypeScript, JavaScript, Python] - products: [Workers, Workers AI, Vectorize, RAG, Hono, D1, R2, AI Gateway] - cloudflare: true - stream_id: 0fe3acaf4dc09ba0285b75af6602c362 - author: craig - updated: 2024-09-18 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/10-kiyJNr8s - title: Build a private AI chatbot using Meta's Llama 3.1 - description: In this video, you will learn how to set up a private AI chat powered by Llama 3.1 for secure, fast interactions, deploy the model on Cloudflare Workers for serverless, scalable performance and use Cloudflare's Workers AI for seamless integration and edge computing benefits. - tags: [Workers, AI] - languages: [TypeScript] - products: [Workers, Workers AI] - cloudflare: true - # stream_id: - author: confidence - updated: 2024-10-07 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/#creator-interview - title: DevTalk | Episode 01 - Yusuke Wada, creator of Hono Framework - description: In this interview, Yusuke Wada reflects on his journey in developing Hono. - tags: [Pages, Workers] - languages: [TypeScript] - products: [Pages, Workers, Workers AI] - cloudflare: true - author: yusuke - updated: 2024-10-08 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: interview - - link: https://youtu.be/W45MIi_t_go - title: Building Front-End Applications | Now Supported by Cloudflare Workers - description: You can now build front-end applications, just like you do on Cloudflare Pages, but with the added benefit of Workers. - tags: [Workers, Workers AI] - languages: [TypeScript] - stream_id: 84039c66f18a34fa70cae7e2a0e70dae - products: [Workers, Workers AI] - cloudflare: true - author: confidence - updated: 2024-10-23 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/HXOpxNaKUzw - title: How to Build Event-Driven Applications with Cloudflare Queues - description: In this video, we demonstrate how to build an event-driven application using Cloudflare Queues. Event-driven system lets you decouple services, allowing them to process and scale independently. - tags: [Workers, Queues] - languages: [TypeScript] - # stream_id: - products: [Workers, Workers AI] - cloudflare: true - author: harshil - updated: 2024-09-26 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/slS4RBV0SBk - title: Cloudflare Workflows | Introduction (Part 1 of 3) - description: In this video, we introduce Cloudflare Workflows, the Newest Developer Platform Primitive at Cloudflare. - tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - languages: [TypeScript] - # stream_id: - products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - cloudflare: true - author: craig - updated: 2024-10-30 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/y4PPsvHrQGA - title: Cloudflare Workflows | Batching and Monitoring Your Durable Execution (Part 2 of 3) - description: Workflows exposes metrics such as execution, error rates, steps, and total duration! - tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - languages: [TypeScript] - # stream_id: - products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - cloudflare: true - author: craig - updated: 2024-10-30 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/L6gR4Yr3UW8 - title: Cloudflare Workflows | Schedule and Sleep For Your Apps (Part 3 of 3) - description: Cloudflare Workflows allows you to initiate sleep as an explicit step, which can be useful when you want a Workflow to wait, schedule work ahead, or pause until an input or other external state is ready. - tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - languages: [TypeScript] - # stream_id: - products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] - cloudflare: true - author: craig - updated: 2024-10-30 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/workers/frameworks/framework-guides/nextjs/#video-tutorial - title: Deploy Your NextJS Application To Workers - description: Watch to learn how to easily deploy your NextJS application to the Cloudflare global network. - tags: [NextJS, Workers, Pages] - languages: [TypeScript] - # stream_id: - products: [Workers, Pages] - cloudflare: true - author: confidence - updated: 2024-10-31 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/workers/observability/logs/#video-tutorial - title: Workers Observability - description: With Workers Logs, you can collect, store, filter, and analyze all logging data from your Workers directly in the Cloudflare dashboard. - tags: [Workers, Pages] - languages: [TypeScript] - # stream_id: - products: [Workers, Pages] - cloudflare: true - author: confidence - updated: 2024-10-31 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/RmF05GpLE20 - title: DevTalk Episode 02 | Post-Quantum Cryptography - description: Bas Westerbaan is Cloudflare’s Research Lead on Post-Quantum efforts. His work ranges from cryptographic implementation and standardization, to driving large-scale experiment and subsequent deployment. - tags: [SSL] - languages: [TypeScript] - products: [SSL] - cloudflare: true - author: bas - updated: 2024-11-14 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/xu4Wb-IppmM - title: OpenAI Relay Server on Cloudflare Workers - description: In this video, Craig Dennis walks you through the deployment of OpenAI's relay server to use with their realtime API. - tags: [Workers, Workers AI, Pages] - languages: [TypeScript] - products: [Workers, Workers AI, Pages] - cloudflare: true - author: craig - updated: 2024-11-14 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/workers/runtime-apis/rpc/#video-tutorial - title: Workers RPC Tutorial - description: Learn how to implement RPC in your JavaScript applications and build serverless solutions. - tags: [Workers, Pages] - languages: [TypeScript] - products: [Workers, Pages] - cloudflare: true - author: confidence - updated: 2024-11-10 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://youtu.be/B2bLUc3iOsI - title: Deploy your React App to Cloudflare Workers - description: Learn how to deploy an existing React application to Cloudflare Workers. - tags: [Workers, Pages] - languages: [TypeScript] - products: [Workers, Pages] - cloudflare: true - author: confidence - updated: 2024-11-05 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/pages/framework-guides/deploy-an-astro-site/#video-tutorial - title: Build a Full-Stack Application using Astro and Cloudflare Workers - description: Learn how to deploy an Astro application to Cloudflare Workers. - tags: [Workers, Pages, Astro] - languages: [TypeScript] - products: [Workers, Pages] - cloudflare: true - author: kristian - updated: 2024-11-19 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/workflows/examples/twilio/ - title: Schedule Twilio Messaging and Phone Calls with Workflows - description: Integrate Workflows with Twilio. Learn how to receive and send text messages and phone calls via APIs and Webhooks. - tags: [Workers, Workflows] - languages: [TypeScript] - products: [Workers, Workflows] - cloudflare: true - author: craig - updated: 2024-11-30 - difficulty: Intermediate - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/pages/framework-guides/deploy-a-nuxt-site/#video-tutorial - title: Deploy Your Nuxt Application To Workers - description: Watch to learn how to easily deploy your Nuxt application to the Cloudflare global network. - tags: [Workers, Pages, NextJS] - languages: [TypeScript] - products: [Workers, Pages] - cloudflare: true - author: kristian - updated: 2025-01-08 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - - link: https://developers.cloudflare.com/workers-ai/tutorials/image-generation-playground/ - title: How to Build an Image Generator using Workers AI - description: In this series of videos, learn how to build an AI Image Playground, add new AI Models and store your generated images using R2. - tags: [Workers, R2, Workers AI] - languages: [TypeScript] - products: [Workers, R2, Workers AI] - cloudflare: true - author: kristian - updated: 2025-01-29 - difficulty: Beginner - content_type: πŸŽ₯ Video - pcx_content_type: tutorial - # - link: - # title: - # description: - # tags: [Workers] - # languages: [TypeScript] - # products: [Workers] - # cloudflare: true - # author: - # updated: - # difficulty: Intermediate - # content_type: πŸŽ₯ Video - # pcx_content_type: tutorial \ No newline at end of file +- link: https://www.youtube.com/watch?v=Id5oKCa__IA + id: Tool Calling Also Known as Function Calling on Cloudflare Workers AI + description: Tool calling, also known as function calling, is a powerful concept that lets you build Large Language Model based applications that can perform actions and retrieve external information from defined tools. + tags: [AI] + languages: [TypeScript] + products: [Workers AI] + cloudflare: true + stream_id: 603e94c9803b4779dd612493c0dd7125 + author: craig + updated: 2024-06-20 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=MlV9Kvkh9hw + id: Build a URL Shortener with an AI-based admin section + description: We are building a URL Shortener, shrty.dev, on Cloudflare. The apps uses Workers KV and Workers Analytics engine. Craig decided to build with Workers AI runWithTools to provide a chat interface for admins. + tags: [Workers Analytics Engine, AI] + products: [Workers AI, KV] + languages: [TypeScript] + cloudflare: true + author: craig + updated: 2024-07-01 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=dttu4QtKkO0 + id: Build Rust Powered Apps + description: In this video, we will show you how to build a global database using workers-rs to keep track of every country and city you’ve visited. + tags: [] + languages: [Rust] + products: [Workers, KV] + cloudflare: true + author: confidence + updated: 2024-06-25 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=GRpwVMkVmKo + id: API Roll (Father's Day) + description: This walks through how to use Workers AI with Hono and Zod to create a streaming pun generating API. + tags: [AI, Hono] + languages: [TypeScript] + products: [Workers AI] + cloudflare: true + author: craig + updated: 2024-06-15 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=MLbo7MGY_lU + id: AI can see clearly now - Build Vision Apps on Cloudflare Workers AI + description: The LlaVa model is hosted on Cloudflare Workers AI. Which means you are an API call away from brand new powerful vision use cases in all of your applications. + tags: [AI] + languages: [TypeScript] + products: [Workers AI] + cloudflare: true + author: craig + updated: 2024-06-11 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=QTsaAhFvX9o + id: Stateful Apps with Cloudflare Workers + description: Learn how to access external APIs, cache and retrieve data using Workers KV, and create SQL-driven applications with Cloudflare D1. + tags: [] + languages: [TypeScript, SQL] + products: [Workers, KV, D1] + cloudflare: true + author: kristian + updated: 2024-05-22 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=5UTExUQ8Fwo + id: Workers AI - Getting Started - Vanilla Chat App + description: Get started building AI apps on Cloudflare using Pages and the GitHub starter template for a Vanilla JavaScript Chat App. + tags: [AI] + languages: [TypeScript] + products: [Workers AI] + cloudflare: true + author: craig + updated: 2024-04-17 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=H7Qe96fqg1M + id: Learn Cloudflare Workers - Full Course for Beginners + description: Learn how to build your first Cloudflare Workers application and deploy it to Cloudflare's global network. + tags: [] + products: [Workers] + languages: [TypeScript] + cloudflare: true + author: kristian + updated: 2024-03-12 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=8SnrvAYAJ4Q + id: Image Generation, Inpainting, and Vision Models + description: Is that person you are about to swipe right on, actually real? Are they AI Generated? + tags: [AI] + products: [Workers AI] + languages: [Python] + cloudflare: true + author: craig + updated: 2024-03-08 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=9JM5Z0KzQsQ + id: Learn AI Development (models, embeddings, vectors) + description: In this workshop, Kristian Freeman, Cloudflare Developer Advocate, teaches the basics of AI Development - models, embeddings, and vectors (including vector databases). + tags: [AI] + products: [Workers AI, Workers, Vectorize] + cloudflare: true + author: kristian + updated: 2023-12-14 + difficulty: Advanced + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=idKdjA8t0jw + id: Optimize your AI App & fine-tune models (AI Gateway, R2) + description: In this workshop, Kristian Freeman, Cloudflare Developer Advocate, shows how to optimize your existing AI applications with Cloudflare AI Gateway, and how to finetune OpenAI models using R2. + tags: [AI] + products: [Workers, R2, AI Gateway] + languages: [JavaScript] + cloudflare: true + author: kristian + updated: 2023-12-14 + difficulty: Advanced + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://www.youtube.com/watch?v=CHfKeFakGAI + id: How to use Cloudflare AI models and inference in Python with Jupyter Notebooks + description: Cloudflare Workers AI provides a ton of AI models and inference capabilities. In this video, we will explore how to make use of Cloudflare’s AI model catalog using a Python Jupyter Notebook. + tags: [AI] + languages: [Python] + products: [Workers, AI Gateway] + cloudflare: true + author: craig + updated: 2023-12-14 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/cK_leoJsBWY + id: Cloudflare Workers AI, Building a "Hello, World" AI App! + description: Cloudflare's Workers AI helps you add AI functionality to the apps you are building. In this video we show you how simple and straightforward it is to build the Hello World of AI apps in under 5 minutes. + tags: [Workers, AI] + languages: [TypeScript] + products: [Workers AI] + cloudflare: true + stream_id: 0b251ede0256f04f24f9127587e0c3aa + author: craig + updated: 2024-09-11 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/9IjfyBJsJRQ + id: Use Vectorize to add additional context to your AI Applications through RAG + description: A RAG based AI Chat app that uses Vectorize to access video game data for employees of Gamertown. + tags: [Workers, AI, Vectorize, RAG, Hono] + languages: [TypeScript] + products: [Workers, Workers AI, Vectorize] + cloudflare: true + # stream_id: 0b251ede0256f04f24f9127587e0c3aa + author: craig + updated: 2024-09-12 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/doKt9wWQF9A + id: AI meets Maps | Using Cloudflare AI, Langchain, Mapbox, Folium and Streamlit + description: Welcome to RouteMe, a smart tool that helps you plan the most efficient route between landmarks in any city. Powered by Cloudflare Workers AI, Langchain and Mapbox. This Streamlit webapp uses LLMs and Mapbox off my scripts API to solve the classic traveling salesman problem, turning your sightseeing into an optimized adventure! + tags: [Workers, Workers AI] + languages: [Python] + products: [Workers, Workers AI] + cloudflare: true + stream_id: f610dee9aa20ec843b0e451b3014540a + author: lizzie + updated: 2024-09-16 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/bwJkwD-F0kQ + id: Welcome to the Cloudflare Developer Channel + description: Welcome to the Cloudflare Developers YouTube channel. We've got tutorials and working demos and everything you need to level up your projects. Whether you're working on your next big thing or just dorking around with some side projects, we've got you covered! So why don't you come hang out, subscribe to our developer channel and together we'll build something awesome. You're gonna love it. + tags: [Workers, AI, Vectorize, RAG, Hono, D1, R2, AI Gateway] + languages: [TypeScript, JavaScript, Python] + products: [Workers, Workers AI, Vectorize, RAG, Hono, D1, R2, AI Gateway] + cloudflare: true + stream_id: 0fe3acaf4dc09ba0285b75af6602c362 + author: craig + updated: 2024-09-18 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/10-kiyJNr8s + id: Build a private AI chatbot using Meta's Llama 3.1 + description: In this video, you will learn how to set up a private AI chat powered by Llama 3.1 for secure, fast interactions, deploy the model on Cloudflare Workers for serverless, scalable performance and use Cloudflare's Workers AI for seamless integration and edge computing benefits. + tags: [Workers, AI] + languages: [TypeScript] + products: [Workers, Workers AI] + cloudflare: true + # stream_id: + author: confidence + updated: 2024-10-07 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/#creator-interview + id: DevTalk | Episode 01 - Yusuke Wada, creator of Hono Framework + description: In this interview, Yusuke Wada reflects on his journey in developing Hono. + tags: [Pages, Workers] + languages: [TypeScript] + products: [Pages, Workers, Workers AI] + cloudflare: true + author: yusuke + updated: 2024-10-08 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: interview +- link: https://youtu.be/W45MIi_t_go + id: Building Front-End Applications | Now Supported by Cloudflare Workers + description: You can now build front-end applications, just like you do on Cloudflare Pages, but with the added benefit of Workers. + tags: [Workers, Workers AI] + languages: [TypeScript] + stream_id: 84039c66f18a34fa70cae7e2a0e70dae + products: [Workers, Workers AI] + cloudflare: true + author: confidence + updated: 2024-10-23 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/HXOpxNaKUzw + id: How to Build Event-Driven Applications with Cloudflare Queues + description: In this video, we demonstrate how to build an event-driven application using Cloudflare Queues. Event-driven system lets you decouple services, allowing them to process and scale independently. + tags: [Workers, Queues] + languages: [TypeScript] + # stream_id: + products: [Workers, Workers AI] + cloudflare: true + author: harshil + updated: 2024-09-26 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/slS4RBV0SBk + id: Cloudflare Workflows | Introduction (Part 1 of 3) + description: In this video, we introduce Cloudflare Workflows, the Newest Developer Platform Primitive at Cloudflare. + tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + languages: [TypeScript] + # stream_id: + products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + cloudflare: true + author: craig + updated: 2024-10-30 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/y4PPsvHrQGA + id: Cloudflare Workflows | Batching and Monitoring Your Durable Execution (Part 2 of 3) + description: Workflows exposes metrics such as execution, error rates, steps, and total duration! + tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + languages: [TypeScript] + # stream_id: + products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + cloudflare: true + author: craig + updated: 2024-10-30 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/L6gR4Yr3UW8 + id: Cloudflare Workflows | Schedule and Sleep For Your Apps (Part 3 of 3) + description: Cloudflare Workflows allows you to initiate sleep as an explicit step, which can be useful when you want a Workflow to wait, schedule work ahead, or pause until an input or other external state is ready. + tags: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + languages: [TypeScript] + # stream_id: + products: [Workflows, Workers, Queues, Workers AI, AI Gateway, KV] + cloudflare: true + author: craig + updated: 2024-10-30 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/workers/frameworks/framework-guides/nextjs/#video-tutorial + id: Deploy Your NextJS Application To Workers + description: Watch to learn how to easily deploy your NextJS application to the Cloudflare global network. + tags: [NextJS, Workers, Pages] + languages: [TypeScript] + # stream_id: + products: [Workers, Pages] + cloudflare: true + author: confidence + updated: 2024-10-31 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/workers/observability/logs/#video-tutorial + id: Workers Observability + description: With Workers Logs, you can collect, store, filter, and analyze all logging data from your Workers directly in the Cloudflare dashboard. + tags: [Workers, Pages] + languages: [TypeScript] + # stream_id: + products: [Workers, Pages] + cloudflare: true + author: confidence + updated: 2024-10-31 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/RmF05GpLE20 + id: DevTalk Episode 02 | Post-Quantum Cryptography + description: Bas Westerbaan is Cloudflare’s Research Lead on Post-Quantum efforts. His work ranges from cryptographic implementation and standardization, to driving large-scale experiment and subsequent deployment. + tags: [SSL] + languages: [TypeScript] + products: [SSL] + cloudflare: true + author: bas + updated: 2024-11-14 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/xu4Wb-IppmM + id: OpenAI Relay Server on Cloudflare Workers + description: In this video, Craig Dennis walks you through the deployment of OpenAI's relay server to use with their realtime API. + tags: [Workers, Workers AI, Pages] + languages: [TypeScript] + products: [Workers, Workers AI, Pages] + cloudflare: true + author: craig + updated: 2024-11-14 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/workers/runtime-apis/rpc/#video-tutorial + id: Workers RPC Tutorial + description: Learn how to implement RPC in your JavaScript applications and build serverless solutions. + tags: [Workers, Pages] + languages: [TypeScript] + products: [Workers, Pages] + cloudflare: true + author: confidence + updated: 2024-11-10 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://youtu.be/B2bLUc3iOsI + id: Deploy your React App to Cloudflare Workers + description: Learn how to deploy an existing React application to Cloudflare Workers. + tags: [Workers, Pages] + languages: [TypeScript] + products: [Workers, Pages] + cloudflare: true + author: confidence + updated: 2024-11-05 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/pages/framework-guides/deploy-an-astro-site/#video-tutorial + id: Build a Full-Stack Application using Astro and Cloudflare Workers + description: Learn how to deploy an Astro application to Cloudflare Workers. + tags: [Workers, Pages, Astro] + languages: [TypeScript] + products: [Workers, Pages] + cloudflare: true + author: kristian + updated: 2024-11-19 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/workflows/examples/twilio/ + id: Schedule Twilio Messaging and Phone Calls with Workflows + description: Integrate Workflows with Twilio. Learn how to receive and send text messages and phone calls via APIs and Webhooks. + tags: [Workers, Workflows] + languages: [TypeScript] + products: [Workers, Workflows] + cloudflare: true + author: craig + updated: 2024-11-30 + difficulty: Intermediate + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/pages/framework-guides/deploy-a-nuxt-site/#video-tutorial + id: Deploy Your Nuxt Application To Workers + description: Watch to learn how to easily deploy your Nuxt application to the Cloudflare global network. + tags: [Workers, Pages, NextJS] + languages: [TypeScript] + products: [Workers, Pages] + cloudflare: true + author: kristian + updated: 2025-01-08 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +- link: https://developers.cloudflare.com/workers-ai/tutorials/image-generation-playground/ + id: How to Build an Image Generator using Workers AI + description: In this series of videos, learn how to build an AI Image Playground, add new AI Models and store your generated images using R2. + tags: [Workers, R2, Workers AI] + languages: [TypeScript] + products: [Workers, R2, Workers AI] + cloudflare: true + author: kristian + updated: 2025-01-29 + difficulty: Beginner + content_type: πŸŽ₯ Video + pcx_content_type: tutorial +# - link: +# id: +# description: +# tags: [Workers] +# languages: [TypeScript] +# products: [Workers] +# cloudflare: true +# author: +# updated: +# difficulty: Intermediate +# content_type: πŸŽ₯ Video +# pcx_content_type: tutorial diff --git a/src/schemas/apps.ts b/src/schemas/apps.ts index b9b808fcb4800fa..c5d488887bf59dd 100644 --- a/src/schemas/apps.ts +++ b/src/schemas/apps.ts @@ -1,18 +1,15 @@ import { z } from "astro:schema"; -export const appsSchema = z.object({ - entries: z - .object({ - link: z.string().url(), - name: z.string(), - description: z.string(), - tags: z.string().array().optional(), - products: z.string().array(), - languages: z.string().array(), - cloudflare: z.boolean(), - author: z.string().optional(), - updated: z.coerce.date(), - }) - .strict() - .array(), -}); +export const appsSchema = z + .object({ + id: z.string(), + link: z.string().url(), + description: z.string(), + tags: z.string().array().optional(), + products: z.string().array(), + languages: z.string().array(), + cloudflare: z.boolean(), + author: z.string().optional(), + updated: z.coerce.date(), + }) + .strict(); diff --git a/src/schemas/videos.ts b/src/schemas/videos.ts index d8ec3bdd9707f02..4772461a997e425 100644 --- a/src/schemas/videos.ts +++ b/src/schemas/videos.ts @@ -1,22 +1,19 @@ import { z } from "astro:schema"; -export const videosSchema = z.object({ - entries: z - .object({ - link: z.string().url(), - title: z.string(), - description: z.string(), - tags: z.string().array().optional(), - products: z.string().array(), - cloudflare: z.boolean(), - stream_id: z.string().optional(), - author: z.string(), - updated: z.coerce.date(), - difficulty: z.string(), - content_type: z.string(), - pcx_content_type: z.string(), - languages: z.string().array().optional(), - }) - .strict() - .array(), -}); +export const videosSchema = z + .object({ + id: z.string(), + link: z.string().url(), + description: z.string(), + tags: z.string().array().optional(), + products: z.string().array(), + cloudflare: z.boolean(), + stream_id: z.string().optional(), + author: z.string(), + updated: z.coerce.date(), + difficulty: z.string(), + content_type: z.string(), + pcx_content_type: z.string(), + languages: z.string().array().optional(), + }) + .strict(); diff --git a/src/util/rehype.ts b/src/util/rehype.ts new file mode 100644 index 000000000000000..1c88c639ab97f49 --- /dev/null +++ b/src/util/rehype.ts @@ -0,0 +1,13 @@ +import { rehype } from "rehype"; +import type { PluggableList } from "unified"; + +export async function process(html: string, plugins: PluggableList) { + const file = await rehype() + .data("settings", { + fragment: true, + }) + .use(plugins) + .process(html); + + return file.toString(); +}