๐ Dynamic Book Update Guide โ
๐ Update Methods Overview โ
You can update this dynamic book through several different approaches:
1. ๐ Direct GitHub Web Editing (Recommended for Beginners) โ
Best for: Modifying existing articles, fixing errors, small content updates
Steps:
- Visit your GitHub repository:
https://github.com/Zhanbingli/my_ebook - Navigate to the file you want to edit (e.g.,
docs/en/articles/education-ai.md) - Click the โ๏ธ "Edit this file" button in the top right
- Make your changes in the online editor
- Fill out the commit information:
Title: Update AI education article - Add new case study Description: Added practical application examples in chapter 3, enhanced theoretical explanations - Select "Commit directly to the main branch"
- Click "Commit changes"
โก Auto-deployment: Your changes will be live in 2-3 minutes!
2. ๐ป Local Development Environment (Recommended for Power Users) โ
Best for: Major modifications, adding multiple files, previewing changes
Initial Setup:
# Clone repository to local machine
git clone https://github.com/Zhanbingli/my_ebook.git
cd my_ebook
# Install dependencies
npm install
# Start local preview server
npm run devDaily Update Workflow:
# 1. Pull latest changes
git pull origin main
# 2. Edit files (using your favorite editor)
# 3. Preview changes
npm run dev
# Visit http://localhost:5173 to see changes
# 4. Commit and push changes
git add .
git commit -m "Update: Add new learning notes"
git push origin main3. ๐ Adding New Articles โ
Method A: Online Creation
- On GitHub, navigate to
docs/en/articles/directory - Click "Add file" โ "Create new file"
- Use filename format:
new-article-name.md - Write content following Markdown format
Method B: Local Creation
# Create new article file
touch docs/en/articles/my-new-article.md
# Edit file content
# Update sidebar configuration๐ Update Navigation Menu: After adding new articles, update the sidebar configuration in docs/.vitepress/config.mjs:
// In the 'en' locale section
sidebar: [
{
text: 'Articles',
items: [
{ text: 'Educational Revolution in AI Era', link: '/en/articles/education-ai' },
{ text: 'Research Paper', link: '/en/articles/research-paper' },
{ text: 'Dialogue with ChatGPT', link: '/en/articles/chatgpt-communication' },
{ text: 'Records', link: '/en/articles/records' },
{ text: 'My New Article', link: '/en/articles/my-new-article' } // Add this line
]
}
]๐ Content Writing Standards โ
Markdown Format Requirements โ
# Article Title
## Main Section
### Subsection
- List items
- Use proper punctuation
**Bold important content**
> Quote content
\`\`\`javascript
// Code block example
console.log("Hello World");
\`\`\`Adding Images โ
# Method 1: Relative path

# Method 2: External link
๐ Update Best Practices โ
Commit Message Standards โ
# Good commit messages
git commit -m "Update: AI education article adds practical cases"
git commit -m "Fix: Correct error in chapter 3"
git commit -m "Add: Learning methodology article"
# Avoid these commit messages
git commit -m "update"
git commit -m "fix"Update Frequency Recommendations โ
- Small fixes: Update anytime (corrections, additions)
- New articles: 1-2 times per week
- Major revisions: Prepare in branches, test thoroughly before merging
Version Management โ
# Create feature branch (for major changes)
git checkout -b feature/new-chapter
# After editing
git push origin feature/new-chapter
# Create Pull Request on GitHub๐ Advanced Features โ
1. Automated Workflows โ
- โ Auto-deploy to GitHub Pages on every commit
- โ Auto-generate sitemap
- โ Auto-optimize search index
2. Collaboration Features โ
- Issue Tracking: Discuss improvements in GitHub Issues
- Pull Requests: Invite others to contribute content
- Comment System: Consider integrating Giscus comments
3. Analytics & Insights โ
- GitHub Insights: View repository access statistics
- Optional Integration: Google Analytics and other analytics tools
๐ Common Issues โ
Q: Website not updating after changes? A: Check if GitHub Actions ran successfully. Usually takes 2-3 minutes to deploy.
Q: How to recover accidentally deleted content? A: Find previous versions in GitHub history, copy content or restore entire file.
Q: How to preview changes? A: Use local development environment npm run dev, or view file preview on GitHub.
Q: Can I schedule content publishing? A: Yes, requires modifying GitHub Actions workflow to add scheduled triggers.
๐ Multi-language Support โ
Adding Content in Different Languages โ
For Chinese content: Place files in docs/ directory For English content: Place files in docs/en/ directory
# Chinese article
docs/articles/my-chinese-article.md
# English article
docs/en/articles/my-english-article.mdLanguage-specific Configuration โ
Update both language sections in docs/.vitepress/config.mjs:
locales: {
root: {
// Chinese configuration
sidebar: [
// Chinese menu items
]
},
en: {
// English configuration
sidebar: [
// English menu items
]
}
}๐ Need Help? โ
- ๐ง Ask questions through GitHub Issues
- ๐ Check the Contributing Guide
- ๐ Reference VitePress Official Documentation
- ๐ Language switching available in top navigation
๐ก Pro Tip: Test major changes locally first before pushing to GitHub!
