<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Daniel Simon Jr</title>
    <link>https://danielsimonjr.github.io/blog</link>
    <description>Personal blog and projects</description>
    <language>en-us</language>
    <atom:link href="https://danielsimonjr.github.io/blog/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Using Images in Blog Posts</title>
      <link>https://danielsimonjr.github.io/blog/using-images-in-posts</link>
      <guid>https://danielsimonjr.github.io/blog/using-images-in-posts</guid>
      <pubDate>Sat, 18 Jan 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[# Using Images in Blog Posts

This post demonstrates how to add images to your blog posts. You can use header images for social sharing, inline images for content, and set Open Graph images for better link previews.

## Header/Open Graph Images

The `image` field in your frontmatter sets the Open Graph image for social media previews. When someone shares your post on Twitter, LinkedIn, or Slack, this image appears in the preview card.

```yaml
---
title: "Your Post Title"
image: "https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=1200&h=630&fit=crop"
---
```

**Recommended dimensions:** 1200x630 pixels (1.91:1 ratio)

## Inline Images

Add images anywhere in your markdown content using standard syntax:

```markdown
![Alt text description](/images/screenshot.png)
```

Here's an example image from Unsplash:

![Laptop on a wooden desk with coffee and notebook](https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=800&h=450&fit=crop)

The alt text appears as a caption below the image.

## Image Sources

You can use images from:

| Source      | Example                           |
| ----------- | --------------------------------- |
| Local files | `/images/my-image.png`            |
| Unsplash    | `https://images.unsplash.com/...` |
| Cloudinary  | `https://res.cloudinary.com/...`  |
| Any CDN     | Full URL to image                 |

### Local Images

Place image files in the `public/images/` directory:

```
public/
  images/
    screenshot.png
    diagram.svg
    photo.jpg
```

Reference them with a leading slash:

```markdown
![Screenshot](/images/screenshot.png)
```

### External Images

Use the full URL for images hosted elsewhere:

```markdown
![Photo](https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=800)
```

Here's a coding-themed image:

![Code on a screen](https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=800&h=450&fit=crop)

## Best Practices

1. **Use descriptive alt text** for accessibility
2. **Optimize image size** before uploading (compress PNG/JPG)
3. **Use CDN URLs** for external images when possible
4. **Match OG image dimensions** to 1200x630 for social previews
5. **Use SVG** for logos and icons

## Free Image Resources

These sites offer free, high-quality images:

- [Unsplash](https://unsplash.com) - Photos
- [Pexels](https://pexels.com) - Photos and videos
- [unDraw](https://undraw.co) - Illustrations
- [Heroicons](https://heroicons.com) - Icons]]></description>
    </item>
    <item>
      <title>How to Publish a Blog Post</title>
      <link>https://danielsimonjr.github.io/blog/how-to-publish</link>
      <guid>https://danielsimonjr.github.io/blog/how-to-publish</guid>
      <pubDate>Fri, 17 Jan 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[# How to Publish a Blog Post

Your blog is set up. Now you want to publish. This guide walks through writing a markdown post and deploying it to your live site.

## Create a New Post

Create a new file in `content/blog/`:

```
content/blog/my-new-post.md
```

The filename can be anything. The URL comes from the `slug` field in the frontmatter.

## Add Frontmatter

Every post starts with frontmatter between triple dashes:

```markdown
---
title: "Your Post Title"
description: "A one-sentence summary for SEO and social sharing"
date: "2025-01-17"
slug: "your-post-url"
published: true
tags: ["tag1", "tag2"]
readTime: "5 min read"
---
```

| Field         | Required | What It Does                        |
| ------------- | -------- | ----------------------------------- |
| `title`       | Yes      | Displays as the post heading        |
| `description` | Yes      | Shows in search results and sharing |
| `date`        | Yes      | Publication date (YYYY-MM-DD)       |
| `slug`        | Yes      | Becomes the URL path                |
| `published`   | Yes      | Set `true` to show, `false` to hide |
| `tags`        | Yes      | Topic labels for the post           |
| `readTime`    | No       | Estimated reading time              |
| `image`       | No       | Open Graph image for social sharing |

## Write Your Content

Below the frontmatter, write your post in markdown:

```markdown
# Your Post Title

Opening paragraph goes here.

## First Section

Content for the first section.

### Subheading

More details here.

- Bullet point one
- Bullet point two

## Code Example

\`\`\`typescript
const greeting = "Hello, world";
console.log(greeting);
\`\`\`

## Conclusion

Wrap up your thoughts.
```

## Build and Deploy

Run the build command:

```bash
npm run build
```

This generates static JSON files from your markdown and builds the site.

Then push to GitHub:

```bash
git add .
git commit -m "Add new post"
git push
```

GitHub Actions will automatically deploy your site.

## Quick Workflow

Here is the full workflow:

1. **Create file**: `content/blog/my-post.md`
2. **Add frontmatter**: Title, description, date, slug, published, tags
3. **Write content**: Markdown with headings, lists, code blocks
4. **Build**: Run `npm run build`
5. **Push**: Commit and push to GitHub
6. **View**: Your post appears at `yourdomain.github.io/blog/your-slug`

## Tips

**Draft posts**: Set `published: false` to save a post without showing it on the site.

**Update existing posts**: Edit the markdown file, rebuild, and push.

**Delete posts**: Remove the markdown file from `content/blog/`, rebuild, and push.

**Unique slugs**: Each post needs a unique slug. The build will warn if two posts share the same slug.

**Date format**: Use YYYY-MM-DD format for the date field.

## Adding Images

Place images in `public/images/` and reference them in your post:

```markdown
![Screenshot of the dashboard](/images/dashboard.png)
```

For the Open Graph image (social sharing), add to frontmatter:

```yaml
image: "/images/my-post-og.png"
```

## Checking Your Post

After building, verify your post:

1. Run `npm run preview` to preview the production build
2. Your post should appear in the post list
3. Click through to check formatting
4. Test code blocks and images render correctly

## Adding Static Pages

You can also create static pages like About, Projects, or Contact. These appear as navigation links.

1. Create a file in `content/pages/`:

```
content/pages/about.md
```

2. Add frontmatter:

```markdown
---
title: "About"
slug: "about"
published: true
order: 1
---

Your page content here...
```

3. Run `npm run build`

The page will appear in the navigation. Use `order` to control the display sequence (lower numbers appear first).

## Summary

Publishing is three steps:

1. Write markdown in `content/blog/` or `content/pages/`
2. Run `npm run build`
3. Push to GitHub

GitHub Actions handles deployment automatically.]]></description>
    </item>
    <item>
      <title>Writing Markdown with Code Examples</title>
      <link>https://danielsimonjr.github.io/blog/markdown-with-code-examples</link>
      <guid>https://danielsimonjr.github.io/blog/markdown-with-code-examples</guid>
      <pubDate>Fri, 17 Jan 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[# Writing Markdown with Code Examples

This post demonstrates how to write markdown content with code blocks, tables, and formatting. Use it as a reference when creating your own posts.

## Frontmatter

Every post starts with frontmatter between `---` delimiters:

```yaml
---
title: "Your Post Title"
description: "A brief description for SEO"
date: "2025-01-17"
slug: "your-url-slug"
published: true
tags: ["tag1", "tag2"]
readTime: "5 min read"
---
```

## Code Blocks

### TypeScript

```typescript
interface Post {
  slug: string;
  title: string;
  description: string;
  content: string;
  date: string;
  tags: string[];
}

async function fetchPosts(): Promise<Post[]> {
  const response = await fetch("/data/posts.json");
  return response.json();
}
```

### React Component

```tsx
import { useState, useEffect } from "react";

interface Post {
  slug: string;
  title: string;
}

export function PostList() {
  const [posts, setPosts] = useState<Post[]>([]);

  useEffect(() => {
    fetch("/data/posts.json")
      .then((res) => res.json())
      .then((data) => setPosts(data));
  }, []);

  return (
    <ul>
      {posts.map((post) => (
        <li key={post.slug}>
          <a href={`/${post.slug}`}>{post.title}</a>
        </li>
      ))}
    </ul>
  );
}
```

### Bash Commands

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview
```

### JSON

```json
{
  "name": "markdown-blog",
  "version": "1.0.0",
  "scripts": {
    "dev": "npm run generate && vite",
    "build": "npm run generate && vite build",
    "generate": "npx tsx scripts/generate-static.ts"
  }
}
```

## Inline Code

Use backticks for inline code like `npm install` or `useState`.

Reference files with inline code: `scripts/generate-static.ts`, `src/pages/Home.tsx`.

## Tables

| Command           | Description                |
| ----------------- | -------------------------- |
| `npm run dev`     | Start development server   |
| `npm run build`   | Build for production       |
| `npm run generate`| Generate static JSON       |
| `npm run preview` | Preview production build   |

## Lists

### Unordered

- Write posts in markdown
- Build generates static JSON
- Deploy to GitHub Pages
- Updates deploy automatically

### Ordered

1. Fork the repository
2. Customize your site
3. Write your posts
4. Push to deploy

## Blockquotes

> Markdown files in your repo are simpler than a CMS. Version controlled, AI-editable, and no separate admin panel.

## Links

External links: [GitHub Pages Docs](https://docs.github.com/en/pages)

Internal links: [Setup Guide](/setup-guide)

## Emphasis

Use **bold** for strong emphasis and _italics_ for lighter emphasis.

## Horizontal Rule

---

## Math Equations

Write mathematical equations using LaTeX syntax with KaTeX rendering.

### Inline Math

The famous equation $E = mc^2$ changed physics forever. The quadratic formula is $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$.

### Block Math

The Gaussian integral:

$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$

A matrix example:

$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
\begin{pmatrix}
x \\
y
\end{pmatrix}
=
\begin{pmatrix}
ax + by \\
cx + dy
\end{pmatrix}
$$

## Mermaid Diagrams

Create diagrams using Mermaid syntax.

### Flowchart

```mermaid
graph TD
    A[Write Post] --> B{Valid Frontmatter?}
    B -->|Yes| C[Build Site]
    B -->|No| D[Fix Frontmatter]
    D --> B
    C --> E[Deploy]
    E --> F[Live on GitHub Pages]
```

### Sequence Diagram

```mermaid
sequenceDiagram
    participant Browser
    participant Server
    participant Database

    Browser->>Server: GET /data/posts.json
    Server->>Database: Query posts
    Database-->>Server: Return posts
    Server-->>Browser: JSON response
    Browser->>Browser: Render posts
```

## Graphviz/DOT Diagrams

Create graph visualizations using DOT language.

```dot
digraph BlogArchitecture {
    rankdir=LR;
    node [shape=box, style=rounded];

    Markdown -> Generator;
    Generator -> JSON;
    JSON -> React;
    React -> Browser;

    Generator [label="Static\nGenerator"];
    Browser [label="User's\nBrowser"];
}
```

## TikZ Diagrams

Render LaTeX TikZ graphics for precise technical illustrations.

```tikz
\begin{tikzpicture}[scale=1.5]
    \draw[->] (-0.5,0) -- (3,0) node[right] {$x$};
    \draw[->] (0,-0.5) -- (0,2) node[above] {$y$};
    \draw[domain=0:2.5, smooth, variable=\x, blue, thick]
        plot ({\x}, {0.5*\x*\x}) node[right] {$y = \frac{x^2}{2}$};
    \fill[red] (1,0.5) circle (2pt);
    \draw[dashed] (1,0) -- (1,0.5) -- (0,0.5);
    \node[below] at (1,0) {$1$};
    \node[left] at (0,0.5) {$\frac{1}{2}$};
\end{tikzpicture}
```

## Inline SVG

Embed SVG graphics directly in your markdown:

<svg width="200" height="100" viewBox="0 0 200 100">
  <rect x="10" y="10" width="80" height="80" rx="10" fill="#4A90A4" opacity="0.8"/>
  <rect x="110" y="10" width="80" height="80" rx="10" fill="#7B68EE" opacity="0.8"/>
  <text x="50" y="55" text-anchor="middle" fill="white" font-size="12">Static</text>
  <text x="150" y="55" text-anchor="middle" fill="white" font-size="12">Simple</text>
</svg>

## Images

Place images in `public/images/` and reference them:

```markdown
![Alt text](/images/screenshot.png)
```

## File Structure Reference

```
content/blog/
├── about-this-blog.md
├── markdown-with-code-examples.md
├── setup-guide.md
└── your-new-post.md
```

## Tips

1. Keep slugs URL-friendly (lowercase, hyphens)
2. Set `published: false` for drafts
3. Run `npm run build` after adding posts
4. Use descriptive titles for SEO
5. Use `$...$` for inline math and `$$...$$` for block math
6. Mermaid supports many diagram types - see [mermaid.js.org](https://mermaid.js.org/)
7. For complex TikZ, test your code in a LaTeX editor first
8. SVG graphics respect theme colors when using `currentColor`]]></description>
    </item>
    <item>
      <title>About This Markdown Site</title>
      <link>https://danielsimonjr.github.io/blog/about-this-blog</link>
      <guid>https://danielsimonjr.github.io/blog/about-this-blog</guid>
      <pubDate>Thu, 16 Jan 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[# About This Markdown Site

This is an open-source static markdown blog built with React, TypeScript, and Vite. Write posts in markdown, build to static files, and deploy to GitHub Pages.

## How It Works

The architecture is straightforward:

1. **Markdown files** live in `content/blog/`
2. **Build script** generates static JSON at build time
3. **React** renders the frontend
4. **GitHub Pages** hosts the static files

When you add a new markdown file and run `npm run build`, your post is included in the static output. Push to GitHub and it deploys automatically.

## The Stack

| Layer    | Technology                |
| -------- | ------------------------- |
| Frontend | React + TypeScript        |
| Build    | Vite                      |
| Styling  | CSS (no framework)        |
| Hosting  | GitHub Pages              |
| Content  | Markdown with frontmatter |

## Why Static?

Static sites are fast, secure, and free to host:

- No server to maintain
- No database to manage
- Free hosting on GitHub Pages
- Fast load times from CDN

## Why Markdown?

Markdown files in your repo are simpler than a CMS:

- Version controlled with git
- Edit with any text editor
- AI agents can create and modify posts
- No separate login or admin panel

## Features

This site includes:

- **Static site generation** from markdown
- **Static pages** for About, Projects, Contact (optional)
- **RSS feeds** at `/rss.xml` and `/rss-full.xml`
- **Sitemap** at `/sitemap.xml`
- **Theme switching** between dark, light, tan, and cloud
- **SEO optimization** with meta tags and structured data
- **AI discovery** via `llms.txt`

## Fork and Deploy

The setup takes about 5 minutes:

1. Fork the repo
2. Run `npm install`
3. Run `npm run build`
4. Enable GitHub Pages in repository settings
5. Push to main branch

Read the [setup guide](/setup-guide) for detailed steps.

## Customization

Edit `src/pages/Home.tsx` to change:

- Site name and description
- Featured posts
- Footer links

Edit `src/styles/global.css` to change:

- Colors and typography
- Theme variables
- Layout spacing

## Links

- [Setup Guide](/setup-guide)
- [GitHub Pages Documentation](https://docs.github.com/en/pages)]]></description>
    </item>
    <item>
      <title>Fork and Deploy Your Own Markdown Blog</title>
      <link>https://danielsimonjr.github.io/blog/setup-guide</link>
      <guid>https://danielsimonjr.github.io/blog/setup-guide</guid>
      <pubDate>Tue, 14 Jan 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[# Fork and Deploy Your Own Markdown Blog

This guide walks you through forking this markdown blog and deploying to GitHub Pages. The entire process takes about 5 minutes.

**How publishing works:** Write posts in markdown, run `npm run build`, push to GitHub, and your site deploys automatically via GitHub Actions.

## Prerequisites

Before you start, make sure you have:

- Node.js 18 or higher installed
- A GitHub account

## Step 1: Fork the Repository

Fork the repository to your GitHub account:

```bash
# Clone your forked repo
git clone https://github.com/YOUR-USERNAME/blog.git
cd blog

# Install dependencies
npm install
```

## Step 2: Run Locally

Start the development server:

```bash
npm run dev
```

Open [http://localhost:5173/blog/](http://localhost:5173/blog/) to see your blog.

## Step 3: Customize Your Site

Update the site configuration in `src/pages/Home.tsx`:

```typescript
const siteConfig = {
  name: "Your Name",
  title: "Your Title",
  intro: "Your introduction...",
  bio: "Your bio...",
  featuredEssays: [{ title: "Post Title", slug: "post-slug" }],
  links: {
    docs: "/docs",
    github: "https://github.com/YOUR-USERNAME/blog",
  },
};
```

Update the site URL in these files:
- `scripts/generate-static.ts` - `SITE_URL` constant
- `src/pages/Post.tsx` - `SITE_URL` constant
- `index.html` - meta tags and JSON-LD

## Step 4: Deploy to GitHub Pages

1. Go to your repository Settings > Pages
2. Set Source to "GitHub Actions"
3. Push to main branch

GitHub Actions will automatically build and deploy your site.

Your blog will be available at: `https://YOUR-USERNAME.github.io/blog/`

## Writing Blog Posts

Create new posts in `content/blog/`:

```markdown
---
title: "Your Post Title"
description: "A brief description for SEO and social sharing"
date: "2025-01-15"
slug: "your-post-url"
published: true
tags: ["tag1", "tag2"]
readTime: "5 min read"
image: "/images/my-post-image.png"
---

Your markdown content here...
```

### Frontmatter Fields

| Field         | Required | Description                   |
| ------------- | -------- | ----------------------------- |
| `title`       | Yes      | Post title                    |
| `description` | Yes      | Short description for SEO     |
| `date`        | Yes      | Publication date (YYYY-MM-DD) |
| `slug`        | Yes      | URL path (must be unique)     |
| `published`   | Yes      | Set to `true` to publish      |
| `tags`        | Yes      | Array of topic tags           |
| `readTime`    | No       | Estimated reading time        |
| `image`       | No       | Header/Open Graph image URL   |

### Adding Images

Place images in `public/images/` and reference them in your posts:

**Header/OG Image (in frontmatter):**

```yaml
image: "/images/my-header.png"
```

This image appears when sharing on social media. Recommended: 1200x630 pixels.

**Inline Images (in content):**

```markdown
![Alt text description](/images/screenshot.png)
```

### Build After Adding Posts

After adding or editing posts, build and push:

```bash
npm run build
git add .
git commit -m "Add new post"
git push
```

GitHub Actions will deploy your changes automatically.

## Customizing Your Blog

### Change the Favicon

Replace `public/favicon.svg` with your own SVG icon.

### Change the Site Logo

Edit `src/pages/Home.tsx`:

```typescript
const siteConfig = {
  logo: "/images/logo.svg", // Set to null to hide the logo
  // ...
};
```

Replace `public/images/logo.svg` with your own logo file.

### Change the Default Open Graph Image

Replace `public/images/og-default.svg` with your own image (1200x630 pixels recommended).

### Change the Default Theme

Edit `src/context/ThemeContext.tsx`:

```typescript
const DEFAULT_THEME: Theme = "tan"; // Options: "dark", "light", "tan", "cloud"
```

### Change the Font

Edit `src/styles/global.css`:

```css
body {
  /* Sans-serif */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Serif (default) */
  font-family: "New York", ui-serif, Georgia, serif;
}
```

### Add Static Pages (Optional)

Create pages in `content/pages/`:

```markdown
---
title: "About"
slug: "about"
published: true
order: 1
---

Your page content here...
```

Pages appear automatically in the navigation when published.

### Update SEO Meta Tags

Edit `index.html` to update:

- Site title
- Meta description
- Open Graph tags
- JSON-LD structured data

### Update llms.txt and robots.txt

Edit `public/llms.txt` and `public/robots.txt` with your site information.

## Static Assets

Your blog includes these static assets:

| Path              | Description             |
| ----------------- | ----------------------- |
| `/rss.xml`        | RSS feed (descriptions) |
| `/rss-full.xml`   | RSS feed (full content) |
| `/sitemap.xml`    | XML sitemap             |
| `/llms.txt`       | AI agent discovery      |
| `/robots.txt`     | Crawler rules           |

## Troubleshooting

### Posts not appearing

1. Check that `published: true` in frontmatter
2. Run `npm run build` to regenerate static files
3. Check the build output for errors

### Build failures

1. Run `npm run typecheck` to check for TypeScript errors
2. Run `npm run lint` to check for linting issues
3. Ensure Node.js version is 18 or higher

## Project Structure

```
blog/
├── content/
│   ├── blog/           # Markdown blog posts
│   └── pages/          # Static pages
├── public/
│   ├── data/           # Generated JSON (by build)
│   ├── images/         # Static images
│   ├── rss.xml         # Generated RSS
│   ├── sitemap.xml     # Generated sitemap
│   └── 404.html        # SPA fallback
├── scripts/
│   └── generate-static.ts  # Build script
├── src/
│   ├── components/     # React components
│   ├── context/        # Theme context
│   ├── pages/          # Page components
│   └── styles/         # CSS
└── .github/
    └── workflows/
        └── deploy.yml  # GitHub Actions
```

## Next Steps

After deploying:

1. Add your own blog posts
2. Customize the theme colors in `global.css`
3. Update the featured essays list
4. Submit your sitemap to Google Search Console
5. Share your first post

Your blog is now live with static site generation, RSS feeds, and SEO optimization. Push new posts and they deploy automatically.]]></description>
    </item>
  </channel>
</rss>