mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
Updated:
- content/blog/raw-markdown-and-copy-improvements.md
- Changed title from 'v1.7 and v1.8' to 'v1.7 to v1.10'
- Added Fork configuration section (v1.10.0) with 9-file table
- Added Scroll-to-top section (v1.9.0) with configuration options
- Updated summary to include all features from v1.7 to v1.10
- Fixed image path to /images/v17.png
- Updated sync command guidance for dev vs prod
- TASK.md
- Added new To Do items for future features
- Removed duplicate Future Enhancements section
- content/pages/docs.md
- Added Mobile menu section
- Added Copy Page dropdown table with all options
- Added Markdown tables section
- content/pages/about.md
- Updated Features list with new v1.8.0 features
- content/blog/setup-guide.md
- Added image field to pages schema
- Updated Project structure with new directories
- Added /raw/{slug}.md to API endpoints
- Added Mobile Navigation and Copy Page Dropdown sections
- Added featured image documentation with ordering details
Documentation now covers all features from v1.7.0 through v1.10.0.
3.7 KiB
3.7 KiB
title, description, date, slug, published, tags, readTime, featured, featuredOrder, image
| title | description | date | slug | published | tags | readTime | featured | featuredOrder | image | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Writing Markdown with Code Examples | A sample post showing how to write markdown with syntax-highlighted code blocks, tables, and more. | 2025-01-17 | markdown-with-code-examples | true |
|
5 min read | true | 5 | /images/markdown.png |
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:
---
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
import { query } from "./_generated/server";
import { v } from "convex/values";
export const getPosts = query({
args: {},
returns: v.array(
v.object({
_id: v.id("posts"),
title: v.string(),
slug: v.string(),
}),
),
handler: async (ctx) => {
return await ctx.db.query("posts").collect();
},
});
React Component
import { useQuery } from "convex/react";
import { api } from "../convex/_generated/api";
export function PostList() {
const posts = useQuery(api.posts.getPosts);
if (posts === undefined) {
return <div>Loading...</div>;
}
return (
<ul>
{posts.map((post) => (
<li key={post._id}>
<a href={`/${post.slug}`}>{post.title}</a>
</li>
))}
</ul>
);
}
Bash Commands
# Install dependencies
npm install
# Start development server
npm run dev
# Sync posts to Convex (development)
npm run sync
# Sync posts to Convex (production)
npm run sync:prod
# Deploy to production
npm run deploy
JSON
{
"name": "markdown-blog",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"sync": "npx ts-node scripts/sync-posts.ts"
}
}
Inline Code
Use backticks for inline code like npm install or useQuery.
Reference files with inline code: convex/schema.ts, src/pages/Home.tsx.
Tables
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run sync |
Sync markdown to Convex (dev) |
npm run sync:prod |
Sync markdown to Convex (prod) |
npx convex dev |
Start Convex dev server |
Lists
Unordered
- Write posts in markdown
- Store in Convex database
- Deploy to Netlify
- Updates sync in real-time
Ordered
- Fork the repository
- Set up Convex backend
- Configure Netlify
- Start writing
Blockquotes
Markdown files in your repo are simpler than a CMS. Commit changes, review diffs, roll back anytime. AI agents can create posts programmatically. No admin panel needed.
Links
External links open in new tabs: Convex Docs
Internal links: Setup Guide
Emphasis
Use bold for strong emphasis and italics for lighter emphasis.
Horizontal Rule
Images
Place images in public/ and reference them:

File Structure Reference
content/blog/
├── about-this-blog.md
├── markdown-with-code-examples.md
├── setup-guide.md
└── your-new-post.md
Tips
- Keep slugs URL-friendly (lowercase, hyphens)
- Set
published: falsefor drafts - Run
npm run syncafter adding posts (ornpm run sync:prodfor production) - Use descriptive titles for SEO