Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions sitemd/0.1.0/sitemd/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/bin/sh
# sitemd install — downloads the sitemd binary for your platform.
# No Node.js required. Run: ./sitemd/install
#
# This script detects your OS and architecture, downloads the correct
# binary from GitHub Releases, and places it at sitemd/sitemd.

set -e

REPO="sitemd-cc/sitemd"
BINARY_NAME="sitemd"

# Detect platform
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

case "$OS" in
darwin) PLATFORM="darwin" ;;
linux) PLATFORM="linux" ;;
mingw*|msys*|cygwin*) PLATFORM="win" ;;
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
esac

case "$ARCH" in
x86_64|amd64) ARCH="x64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac

if [ "$PLATFORM" = "win" ]; then
ASSET="sitemd-${PLATFORM}-${ARCH}.zip"
BINARY_NAME="sitemd.exe"
else
ASSET="sitemd-*-${PLATFORM}-${ARCH}.tar.gz"
fi

# Find the sitemd directory (where this script lives)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

# Check if binary already exists
if [ -f "$SCRIPT_DIR/$BINARY_NAME" ]; then
echo " sitemd binary already installed at $SCRIPT_DIR/$BINARY_NAME"
echo " To reinstall, delete the binary and run this script again."
exit 0
fi

echo " sitemd install"
echo " Platform: ${PLATFORM}-${ARCH}"
echo ""

# Get latest release tag
echo " Finding latest release..."
if command -v curl >/dev/null 2>&1; then
LATEST=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"//;s/".*//')
elif command -v wget >/dev/null 2>&1; then
LATEST=$(wget -qO- "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"//;s/".*//')
else
echo " Error: curl or wget required" >&2
exit 1
fi

if [ -z "$LATEST" ]; then
echo " Error: could not determine latest release" >&2
exit 1
fi

VERSION="${LATEST#v}"
echo " Version: $VERSION"

# Build download URL
ARCHIVE="sitemd-${VERSION}-${PLATFORM}-${ARCH}"
if [ "$PLATFORM" = "win" ]; then
ARCHIVE="${ARCHIVE}.zip"
else
ARCHIVE="${ARCHIVE}.tar.gz"
fi
URL="https://github.com/$REPO/releases/download/$LATEST/$ARCHIVE"

# Download
TMPDIR=$(mktemp -d)
TMPFILE="$TMPDIR/$ARCHIVE"

echo " Downloading $ARCHIVE..."
if command -v curl >/dev/null 2>&1; then
curl -fsSL -o "$TMPFILE" "$URL"
else
wget -q -O "$TMPFILE" "$URL"
fi

# Extract binary
echo " Extracting..."
if [ "$PLATFORM" = "win" ]; then
unzip -qo "$TMPFILE" -d "$TMPDIR/extracted"
else
mkdir -p "$TMPDIR/extracted"
tar -xzf "$TMPFILE" -C "$TMPDIR/extracted"
fi

# Find the binary inside the archive (it's at sitemd/sitemd inside the archive)
EXTRACTED_BIN=$(find "$TMPDIR/extracted" -name "$BINARY_NAME" -type f | head -1)
if [ -z "$EXTRACTED_BIN" ]; then
echo " Error: binary not found in archive" >&2
rm -rf "$TMPDIR"
exit 1
fi

# Install
cp "$EXTRACTED_BIN" "$SCRIPT_DIR/$BINARY_NAME"
chmod +x "$SCRIPT_DIR/$BINARY_NAME"

# Clean up
rm -rf "$TMPDIR"

echo ""
echo " Installed: $SCRIPT_DIR/$BINARY_NAME"
echo " Run: ./sitemd/sitemd launch"
echo ""
72 changes: 72 additions & 0 deletions sitemd/0.1.0/skills/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: sitemd
description: Build and manage sitemd static websites from Markdown. Create pages, generate content, configure settings, and deploy.
---

# sitemd

You are working in a sitemd project — a markdown-based static site builder with MCP integration.

## Project Structure

- `sitemd` — Compiled binary (run `./sitemd/sitemd launch`)
- `install` — Bootstrap script (run `./sitemd/install` to download binary)
- `pages/` — Markdown content files with YAML frontmatter
- `settings/` — Site configuration (YAML frontmatter in `.md` files)
- `theme/` — CSS and HTML templates
- `media/` — Images and assets
- `site/` — Built output

## Available MCP Tools

Use these tools to manage the site:

| Tool | Purpose |
|---|---|
| `sitemd_status` | Project state overview |
| `sitemd_pages_create` | Create new pages (writes file + nav + groups) |
| `sitemd_pages_create_batch` | Create multiple pages in one call |
| `sitemd_pages_delete` | Delete a page (cleans up nav + groups) |
| `sitemd_groups_add_pages` | Add pages to group sidebar |
| `sitemd_site_context` | Site identity, pages, conventions |
| `sitemd_content_validate` | Validate content |
| `sitemd_seo_audit` | SEO health check with scored report |
| `sitemd_init` | Initialize project from template |
| `sitemd_build` | Build site locally |
| `sitemd_deploy` | Build and deploy site |
| `sitemd_activate` | Activate site (permanent) |
| `sitemd_clone` | Clone existing website |
| `sitemd_config_set` | Set backend config |
| `sitemd_update_check` | Check for updates |

Read pages, settings, and groups files directly — no MCP tool needed for reads.

## First Steps

1. Call `sitemd_status` to understand the project state
2. Read files in `pages/` to see existing content
3. Call `sitemd_site_context` with a content type to get site identity, conventions, and existing pages
4. Create pages with `sitemd_pages_create` — use rich components (buttons, cards, embeds, galleries)
5. Validate with `sitemd_content_validate`

## Settings

All configuration lives in `settings/*.md` frontmatter. Key files: `meta.md` (identity), `header.md` (nav), `footer.md` (footer), `groups.md` (page groups), `theme.md` (colors/fonts), `build.md` (dev server), `deploy.md` (deployment).

## Markdown Extensions

Beyond standard markdown, sitemd supports rich components. The syntax reference is below.

- `button: Label: /slug` — styled buttons. Modifiers: `+outline`, `+big`, `+newtab`, `+color:red`
- `card: Title` / `card-text:` / `card-image:` / `card-link:` — responsive card grids
- `embed: URL` — auto-detects YouTube, Vimeo, Spotify, X, CodePen, etc.
- `gallery:` with indented `![alt](url)` — image grid with lightbox
- `image-row:` with indented `![alt](url)` — equal-height image row
- `![alt](url +width:N +circle +bw +expand)` — image modifiers
- `[text]{tooltip content}` — inline tooltips
- `modal: id` with indented content, trigger via `[link](#modal:id)` — modal dialogs
- `{#custom-id}` — inline anchors
- `[text](url+newtab)` — link modifiers
- `form:` with indented YAML — forms
- `gated: type1, type2` ... `/gated` — gated sections
- `data: source` / `data-display: cards|list|table` — dynamic data