blog-cloneutil.tsx2 matches
1export function formatDate(dateString: string): string {
2try {
3const date = new Date(dateString);
12}
1314export function dayOfWeek(dateString: string): string {
15try {
16return new Date(dateString).toLocaleDateString("en-US", {
blog-cloneSocialLinks.tsx1 match
2import { BlueskyIcon, DiscordIcon, GitHubIcon, RSSIcon, TwitterIcon } from "./icons.tsx";
34export default function SocialLinks() {
5return (
6<div className="social-links">
blog-clonerender-markdown.ts1 match
1011// Process markdown content
12export async function processMarkdown(content: string): Promise<string> {
13const result = await unified()
14.use(remarkParse)
blog-cloneREADME.md1 match
31- **`rss.ts`**: RSS feed generation
32- **`favicon.ts`** & **`og-image.ts`**: Asset routes
33- **`/utils/`**: Utility functions for post processing, caching, etc.
34- **`/posts/`**: Markdown files for blog posts
35- **`/styles/`**: CSS styling
blog-cloneproxy.ts1 match
5const OLD_BLOG_URL = "https://val-town-blog.pages.dev/";
67export async function proxyHonoRequest(c: any) {
8const url = new URL(c.req.url);
9
blog-cloneOGImage.tsx1 match
4const LINE_HEIGHT = 72;
56export default function OGImage({
7title = "Val Town Blog",
8...props
blog-cloneLogo.tsx1 match
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
23export default function (props: React.SVGProps<SVGSVGElement>) {
4return (
5<svg
blog-cloneLogoMark.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
23export default function(props: React.SVGProps<SVGSVGElement>) {
4return (
5<svg
18}
1920export function Favicon(props: React.SVGProps<SVGSVGElement>) {
21return (
22<svg
blog-clonelive-reload.ts8 matches
4const client = new ValTown({ bearerToken: "" });
56async function getProjectAndBranchIds(importMetaUrl: string) {
7// imported dynamically because this is server-only but this file is also imported on the client
8const { parseProject } = await import("https://esm.town/v/std/utils@85-main/index.ts");
23}
2425async function projectLastUpdatedAt({ project_id, branch_id }: { project_id: string; branch_id: string }) {
26const { updatedAt } = await client.vals.branches.retrieve(
27project_id,
34* Creates a wrapper around a fetch handler that injects a script tag into HTML responses
35*
36* @param handler The original fetch handler function
37* @param scriptContent The HTML content to inject
38* @returns A new fetch handler with HTML rewriting capability
39*/
40export function injectHTML(
41handler: (request: Request) => Promise<Response>,
42html: string,
43): (request: Request) => Promise<Response> {
44let HTMLRewriter: typeof import("https://ghuc.cc/worker-tools/html-rewriter/index.ts").HTMLRewriter | undefined;
45// Return the new handler function
46return async (request: Request) => {
47if (!HTMLRewriter) {
69}
7071export function liveReload(
72handler: (request: Request) => Promise<Response>,
73importMetaUrl: string,
99* ------------------------------ */
100101async function registerNextCheck(
102{ pageLoad, project_id, branch_id }: { pageLoad: number; project_id: string; branch_id: string },
103) {
126}
127128export async function main(ids: { project_id: string; branch_id: string }) {
129// don't run this on custom domains, ie not on blog.val.run
130if (!window.location.hostname.endsWith(".val.run")) {
blog-cloneLayout.tsx1 match
14}
1516export function Layout({ title, post, children }: LayoutProps) {
17return (
18<html lang="en">