5import Byline from "./Byline.tsx";
6
7export function HomePage({ posts }: { posts: BlogPost[] }) {
8 const latest = posts.at(0);
9 const top = posts.slice(1, 3);
1export function formatDate(dateString: string): string {
2 try {
3 const date = new Date(dateString);
12}
13
14export function dayOfWeek(dateString: string): string {
15 try {
16 return new Date(dateString).toLocaleDateString("en-US", {
8} from "./icons.tsx";
9
10export default function SocialLinks () {
11 return (
12 <div className="social-links">
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3export default function (props: React.SVGProps<SVGSVGElement>) {
4 return (
5 <svg
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3export function RSSIcon (props: React.SVGProps<SVGSVGElement>) {
4 return (
5 <svg
24}
25
26export function TwitterIcon (props: React.SVGProps<SVGSVGElement>) {
27 return (
28 <svg
41}
42
43export function GitHubIcon (props: React.SVGProps<SVGSVGElement>) {
44 return (
45 <svg
59}
60
61export function BlueskyIcon (props: React.SVGProps<SVGSVGElement>) {
62 return (
63 <svg
75}
76
77export function DiscordIcon (props: React.SVGProps<SVGSVGElement>) {
78 return (
79 <svg
5const year = new Date().getFullYear();
6
7export default function Footer () {
8 return (
9 <footer className="container">
2import { formatDate, dayOfWeek } from "./util.tsx";
3
4export default function Byline ({ post }: {
5 post: {
6 author: string;
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
1import Graph from "https://deno.land/x/deno_chart/mod.ts";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 const name = url.searchParams.get("name");
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",