|
| 1 | +# Orionrobots Website |
| 2 | + |
| 3 | +**ALWAYS** reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. |
| 4 | + |
| 5 | +Orionrobots is a static website about robotics using Eleventy (11ty) static site generator with Webpack for asset bundling. The site includes a blog with Jekyll-style posts, wiki pages, and robotics tutorials. It's hosted on 3rd party hosting with Apache configuration. |
| 6 | + |
| 7 | +## Working Effectively |
| 8 | + |
| 9 | +### CRITICAL: Bootstrap and Build Commands |
| 10 | +- Bootstrap and run the repository: |
| 11 | + - `docker compose up` -- **NEVER CANCEL** - builds and starts development server. Set timeout to 300+ seconds for initial build. |
| 12 | +- Build assets and site manually: |
| 13 | + - `docker compose run dist` -- builds webpack bundle.js, takes ~30 seconds |
| 14 | + - `docker compose run build` -- builds full static site, takes ~3 minutes. Set timeout to 240+ seconds. |
| 15 | +- Alternative native workflow: |
| 16 | + ```bash |
| 17 | + npm install |
| 18 | + npm run dist |
| 19 | + npm run 11ty |
| 20 | + ``` |
| 21 | + |
| 22 | +### Development Server |
| 23 | +- Run local development server: |
| 24 | + - `docker compose up serve` -- starts Eleventy dev server on port 8081, **NEVER CANCEL** - builds then watches files. Set timeout to 300+ seconds for initial build. |
| 25 | + - Alternative native: `npm run serve` -- starts Eleventy dev server directly |
| 26 | + - Manual serving: After building, serve with Python: `cd _site && python3 -m http.server 8082` |
| 27 | + |
| 28 | +### Testing Commands |
| 29 | +- BDD integration tests: |
| 30 | + - `docker compose run test` -- runs Cucumber.js tests with Playwright in containerized environment |
| 31 | + - Alternative native: `npm run test:bdd` or `npm test` -- runs tests directly on host |
| 32 | + - **Note**: Playwright installation may fail in some CI environments |
| 33 | + - Tests require a running staging server to test against |
| 34 | + |
| 35 | +## Validation Scenarios |
| 36 | + |
| 37 | +### Manual Validation Required |
| 38 | +**ALWAYS** manually validate any new code by testing these scenarios after making changes: |
| 39 | +1. **Homepage Loading**: Visit the root page and verify navigation works |
| 40 | +2. **Blog Post Access**: Navigate to a recent blog post and verify images load |
| 41 | +3. **Wiki Navigation**: Test wiki links and cross-references work |
| 42 | +4. **Search Functionality**: Test any search features if they exist |
| 43 | + |
| 44 | +### Staging Test Validation |
| 45 | +Always test these key pages that are verified in CI: |
| 46 | +- Homepage: `/` (should return 200 OK) |
| 47 | +- Construction guide: `/construction_guide.html` (should return 200 OK) |
| 48 | +- Wiki pages: `/wiki/lego` and similar (check for 404s) |
| 49 | + |
| 50 | +### Build Verification |
| 51 | +- Run `docker compose run dist && docker compose run build` and verify `_site` directory is created with content |
| 52 | +- Alternative native: `npm run dist && npm run 11ty` |
| 53 | +- Check that `_site/index.html` exists and contains proper HTML structure |
| 54 | +- Verify `dist/bundle.js` exists and is approximately 330KB |
| 55 | + |
| 56 | +## Key Project Structure |
| 57 | + |
| 58 | +### Root Directory Contents |
| 59 | +``` |
| 60 | +.eleventy.js -- Eleventy configuration |
| 61 | +.github/ -- GitHub workflows and scripts |
| 62 | +_config.yml -- Jekyll-style configuration (still used by Eleventy) |
| 63 | +_includes/ -- Liquid templates and layouts |
| 64 | +_posts/ -- Old Jekyll posts structure |
| 65 | +_site/ -- Generated static site (build output) |
| 66 | +content/ -- Main content (blog posts, wiki pages) |
| 67 | +dist/ -- Webpack build output (bundle.js) |
| 68 | +docker-compose.yml -- Docker development environment setup |
| 69 | +package.json -- npm dependencies and scripts |
| 70 | +src/ -- Source files for Webpack |
| 71 | +webpack.config.js -- Webpack configuration |
| 72 | +``` |
| 73 | + |
| 74 | +### Important Scripts and Tools |
| 75 | +- `.github/scripts/new_post.sh "Title"` -- creates new blog post with proper folder structure |
| 76 | +- `npm run stats` -- generates webpack bundle analysis |
| 77 | +- `npm run check-missing-tags` -- lists files without proper tagging |
| 78 | + |
| 79 | +## Build Process Details |
| 80 | + |
| 81 | +### Build Order (Critical) |
| 82 | +1. **Webpack Build** (`docker compose run dist` or `npm run dist`): Creates `dist/bundle.js` with CSS and JS assets |
| 83 | +2. **Eleventy Build** (`docker compose run build` or `npm run 11ty`): Processes markdown, creates HTML, copies assets to `_site/` |
| 84 | + |
| 85 | +### Timing Expectations |
| 86 | +- Docker compose up: ~4-5 minutes for initial build and start (set 300+ second timeout) |
| 87 | +- Docker dist build: ~30 seconds (set 60+ second timeout) |
| 88 | +- Docker site build: ~3 minutes (**NEVER CANCEL** - set 240+ second timeout) |
| 89 | +- Alternative native npm install: ~1 minute (standard timeout OK) |
| 90 | +- Alternative native webpack dist: ~7 seconds (set 30+ second timeout) |
| 91 | +- Alternative native Eleventy build: ~2.5 minutes (**NEVER CANCEL** - set 180+ second timeout) |
| 92 | + |
| 93 | +### Known Build Warnings |
| 94 | +- Sass deprecation warnings about @import rules (normal, build continues) |
| 95 | +- Webpack bundle size warnings (normal, ~330KB bundle.js) |
| 96 | +- Missing thumbnail warnings for some images (normal, falls back gracefully) |
| 97 | + |
| 98 | +## Dependencies and Environment |
| 99 | + |
| 100 | +### Required Dependencies |
| 101 | +- Docker and Docker Compose (primary development environment) |
| 102 | +- Node.js 20+ (for native development alternative) |
| 103 | +- npm 10+ (for native development alternative) |
| 104 | +- Python 3.12+ (for simple HTTP server testing) |
| 105 | + |
| 106 | +### Optional Dependencies |
| 107 | +- pre-commit (for git hooks) |
| 108 | +- Playwright (for BDD testing, included in Docker test environment) |
| 109 | + |
| 110 | +## Configuration Files |
| 111 | + |
| 112 | +### Key Config Files to Understand |
| 113 | +- `_config.yml`: Jekyll-style config still used for menu, site metadata |
| 114 | +- `.eleventy.js`: Main Eleventy configuration, plugins, filters, shortcodes |
| 115 | +- `package.json`: All npm scripts and dependencies |
| 116 | +- `webpack.config.js`: Asset bundling configuration |
| 117 | + |
| 118 | +### Development vs Production |
| 119 | +- Development: Use `docker compose up serve` for live reloading, or `npm run serve` for native development |
| 120 | +- Production: Build with `docker compose run dist && docker compose run build` or `npm run dist && npm run 11ty`, serve from `_site/` |
| 121 | + |
| 122 | +## Common Development Tasks |
| 123 | + |
| 124 | +### Creating New Blog Posts |
| 125 | +```bash |
| 126 | +.github/scripts/new_post.sh "Your Post Title" |
| 127 | +``` |
| 128 | +This creates properly structured content with frontmatter in `content/YYYY/MM/` directory. |
| 129 | + |
| 130 | +### Adding New Assets |
| 131 | +- Images: Place in `galleries/` or `content/YYYY/MM/` for posts |
| 132 | +- CSS/JS: Add to `src/` and import in `src/index.js` |
| 133 | +- Static files: Use Eleventy passthrough copy in `.eleventy.js` |
| 134 | + |
| 135 | +### Troubleshooting Build Issues |
| 136 | +1. Clear containers and rebuild: `docker compose down && docker compose build --no-cache` |
| 137 | +2. Clear build outputs: `docker compose run --rm base rm -rf _site dist` |
| 138 | +3. Rebuild: `docker compose run dist && docker compose run build` |
| 139 | +4. Alternative native troubleshooting: |
| 140 | + - Clear `node_modules`: `rm -rf node_modules && npm install` |
| 141 | + - Clear build outputs: `rm -rf _site dist` |
| 142 | + - Rebuild: `npm run dist && npm run 11ty` |
| 143 | + |
| 144 | +## CI/CD Information |
| 145 | + |
| 146 | +### GitHub Workflows |
| 147 | +- Uses Docker Compose for consistent CI/CD environments |
| 148 | +- Staging tests run BDD Playwright tests (may be flaky) |
| 149 | +- Deployment happens to Apache hosting with htaccess rules |
| 150 | + |
| 151 | +### Pre-commit Hooks |
| 152 | +- Run `pre-commit install` to set up git hooks |
| 153 | +- Uses mega-linter with most linters disabled |
| 154 | +- Focus on security, GitHub Actions, JS, and Markdown linting |
| 155 | + |
| 156 | +## Repository Context |
| 157 | + |
| 158 | +This is a Jekyll-to-Eleventy migrated project (now fully Eleventy) with: |
| 159 | +- Mixed content structure (legacy `_posts/` and new `content/`) |
| 160 | +- Jekyll-style frontmatter and Liquid templates |
| 161 | +- Bootstrap 5 + jQuery frontend |
| 162 | +- Extensive robotics content and tutorials |
| 163 | +- Apache hosting with custom htaccess rules |
| 164 | + |
| 165 | +**CRITICAL REMINDER**: Use Docker Compose as the primary development method. Never cancel long-running builds - they can take 3-5+ minutes for initial setup. |
0 commit comments