7const app = new Hono();
8
9// Function to parse frontmatter from markdown
10function parseMarkdownWithFrontmatter(content: string) {
11 const frontmatterRegex = /^---\n([\s\S]*?)\n---\n/;
12 const match = content.match(frontmatterRegex);
57}
58
59// Function to render a blog post
60function BlogPost({ content, frontmatter }) {
61 // Default values if frontmatter is missing fields
62 const title = frontmatter.title || "Untitled Post";
166 plugins: [
167 tailwind.plugin.withOptions(
168 function (options = {}) {
169 return function ({ addBase, theme }) {
170 const rhythmBase = theme('typography.DEFAULT.css', {});
171 addBase({
4import { Agent } from "https://esm.sh/@atproto/api@0.15.5"
5
6export function App({ client, session }: { client: BrowserOAuthClient, session?: OAuthSession }) {
7 const [clicked, setClicked] = useState(0);
8 const [agent] = useState(new Agent(session))
2
3export const TABLE_NAME = "pondiverse_creations_v4";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 // url query
5 // ?c=id
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)
10}
11
12function initApp() {
13 const root = document.getElementById("root");
14 if (!root) {
4import { HomePage } from "./HomePage.tsx";
5
6export function App() {
7 const [path, setPath] = useState(window.location.pathname);
8
18 }, []);
19
20 // Navigate function for client-side routing
21 const navigate = (to: string) => {
22 window.history.pushState({}, '', to);
19}
20
21export function ValGrid({ vals }: ValGridProps) {
22 if (!vals || vals.length === 0) {
23 return (
19}
20
21export function ValGridItem({ val }: ValGridItemProps) {
22 const [imgError, setImgError] = useState(false);
23 const [moiConfig, setMoiConfig] = useState<any>(null);
25 // Create a deterministic background color based on val name
26 const getBackgroundColor = () => {
27 // Simple hash function for generating a color
28 let hash = 0;
29 const str = val.name + val.username;