# Quick Reference Guide ## Adding Content ### Add a New Page Section ```bash mkdir -p content/mysection echo "# My Section Title" > content/mysection/index.md echo "Your content here..." >> content/mysection/index.md ``` Visit: `http://your-site/mysection` ### Add a Blog Post ```bash echo "# Blog Post Title" > content/blog/my-post-slug.md echo "Post content..." >> content/blog/my-post-slug.md ``` Visit: `http://your-site/blog/my-post-slug` ### Edit Content Just edit the markdown file - changes appear immediately! ```bash nano content/home/index.md # Changes visible at http://your-site/ ``` ## Testing ### Run Tests ```bash php test.php ``` ### Check Setup ```bash # All required files exist? ls -la lib/ partials/ js/ ls -la .htaccess router.php template.php # Content structure? find content -name "*.md" # Comrak installed? comrak --version ``` ## Troubleshooting ### 404 errors on every page 1. Check `.htaccess` is enabled 2. Check content files exist: `ls content/home/index.md` 3. Check error log: `/var/log/apache2/error.log` ### Page shows but no sidebar links 1. Check `partials/sidebar.php` is loading 2. Check `content/*/` directories exist 3. Clear browser cache ### JavaScript not working smoothly 1. Open browser console (F12) 2. Check for JavaScript errors 3. **This is okay!** Site works without JS ### Adding content but it doesn't appear 1. Create file: `content/section/index.md` 2. Make sure first line is: `# Section Title` 3. Reload browser page 4. Check permissions: `ls -la content/section/` ## File Locations | File | Purpose | |------|---------| | `index.php` | Entry point | | `router.php` | Request routing | | `template.php` | Base HTML layout | | `lib/ContentRenderer.php` | Markdown → HTML | | `lib/ContentManager.php` | Content discovery | | `partials/sidebar.php` | Navigation menu | | `partials/footer.php` | Footer | | `js/enhance.js` | Progressive enhancement | | `content/*/` | Your content (markdown) | | `.htaccess` | URL rewriting | ## Common Tasks ### Update sidebar order Edit `partials/sidebar.php` - change `$priority_sections` ### Change page layout Edit `template.php` - modify HTML structure ### Add smooth page transitions Already included in `js/enhance.js` - it's enabled by default! ### Disable JavaScript enhancement Remove or comment out the `