Sitemd import
Import a raw markdown file into the sitemd site as a properly formatted page.
install
source · Clone the upstream repo
git clone https://github.com/sitemd-cc/sitemd
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/sitemd-cc/sitemd "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/import" ~/.claude/skills/sitemd-cc-sitemd-import-b3fb15 && rm -rf "$T"
manifest:
.claude/skills/import/SKILL.mdsource content
Import Markdown File
Convert any raw markdown file into a sitemd page — generating frontmatter, reformatting content, determining group membership, and writing the page file.
Input
The user provides a file path as the argument:
$ARGUMENTS
If no argument is provided, ask the user for the path to the markdown file they want to import.
Procedure
-
Read the source file. Read the raw markdown content at the provided path. If it has existing frontmatter, extract any useful fields (title, description) but the frontmatter itself will be replaced.
-
Gather site context. Call these MCP tools in parallel:
- Glob
— get existing pages to avoid slug collisions and understand structurepages/**/*.md - Read
— get the site name and brandsettings/meta.md - Read
— get available groups for categorizationsettings/groups.md
- Glob
-
Determine metadata:
- Title — Extract from the first
heading in the content, or derive from the filename. Do not append a site title suffix — the build engine adds it automatically.# - Description — Write a concise summary of the page content, under 160 characters. SEO-friendly.
- Slug — Derive from the title, kebab-cased. If assigning to a group, prefix with the group name (e.g.
). Check against existing pages for uniqueness./docs/my-page - Group membership — Based on the content's topic, decide if it fits an existing group. Documentation-style content →
. If no group fits, leave it as a standalone page.docs
- Title — Extract from the first
-
Convert content:
- Strip any existing frontmatter from the source
- Convert YouTube/Vimeo
embeds to<iframe>
syntaxembed: URL - Convert raw HTML image tags to markdown
where practical - Preserve all standard markdown as-is (bold, italic, code blocks, tables, lists, blockquotes, links, images)
- Do NOT add the auto-injected syntax comment block — the build system handles that
-
Create the page. Call
with:sitemd_pages_create
,title
,description
from step 3slug
— the converted markdown bodycontent
— array of group names if assigned (e.g.groupMember
)["docs"]
— same as group name if assignedsidebarGroupShown
-
Report results:
- File path created
- Slug / URL
- Group assignment (if any)
- Any warnings (unresolved local image paths, content that couldn't be auto-converted)
- Remind the user that the dev server auto-rebuilds, or suggest
if it's not running/launch
Rules
- No permission required — Execute immediately without asking
- Never overwrite — If the target file already exists, report the conflict and ask the user what to do
- Preserve content — The goal is faithful conversion, not rewriting. Keep the author's voice and structure.
- Frontmatter field order — title, description, slug, sidebarGroupShown, groupMember
- Match conventions — Look at existing pages' title format, description style, and slug patterns