The built-in markdown editor provides a live preview environment for writing and testing your blog posts.
Navigate to /?page=markdown or click MarkDown in the navigation.
Example: http://localhost:3000/?page=markdown
- Split-screen layout - Editor on left, preview on right
- Real-time updates - See changes as you type
- Exact rendering - Preview matches your blog's styling
- GitHub Flavored Markdown
- Headers (H1-H6)
- Bold, italic,
strikethrough - Links
- Lists (ordered/unordered) and task lists
- Images
- Footnotes
- Code blocks with syntax highlighting
- LaTeX math formulas
- Tables
- Typora-style block quotes
- Horizontal dividers for H1/H2
Configure in /src/config.js:
markdown: {
enable: true, // Enable/disable editor
loading: false, // Show loading animation
renderDelay: 0, // Debounce delay (milliseconds)
tabSize: 2, // Tab indentation (2 or 4 spaces)
linkStyle: {
textDecoration: 'none',
color: '#0077ff'
}
}| Shortcut | Action |
|---|---|
Tab |
Indent line |
Shift+Tab |
Unindent line |
Ctrl/Cmd + A |
Select all |
Ctrl/Cmd + C |
Copy |
Ctrl/Cmd + V |
Paste |
- Open the editor
- Write your content with live preview
- Copy the markdown when satisfied
- Save to
/src/articles/YourPost.md - Add to navigation in config
- Verify complex markdown renders correctly
- Test table formatting
- Preview math formulas
- Check image alignment
- Paste content from other editors
- Convert formatting to markdown
- Preview before publishing
Each article page has a flip button (top-right corner) that toggles between:
- Preview Mode - Rendered markdown view
- Edit Mode - Raw markdown with live preview
This allows quick edits to existing articles without opening the full editor.
Planned enhancements:
- Auto-save & recover
- Export to markdown file
- Export to PDF
- Notion-style block editor
- Video embed support (YouTube, Bilibili)
- Data tables with sorting
- Set
renderDelay: 300for large documents - Reduces CPU usage while typing
- Still shows preview after you pause
Use external image URLs for best performance:
Specify language for syntax highlighting:
const greeting = "Hello World";
console.log(greeting);For configuration options, see Configuration Guide.