|
1 | 1 | # Project MONAI Website
|
2 |
| -This repo contains source code and content for the project MONAI website found at [monai.io](https://monai.io/). You can find out more on the [Project-MONAI github](https://github.com/Project-MONAI). |
3 | 2 |
|
4 |
| -## Local Development |
5 |
| -Git clone this repo, run 'python -m http.server' and navigate to localhost:8000 or your indicated port. |
| 3 | +This repository contains the source code and content for the Project MONAI website found at [monai.io](https://monai.io/). For more information about MONAI, visit the [Project-MONAI GitHub](https://github.com/Project-MONAI). |
6 | 4 |
|
7 |
| -The CSS is minimized to use only the included classes required throughout all the pages. If you're looking to add classes that aren't currently used, make sure to use npm to install the relevant packages and build the tailwind CSS after updating the .html files. Alternatively, after installing npm dependencies, run the 'npm run watch' command to automatically re-build the CSS file everytime you modify an .html file. |
| 5 | +## Features |
8 | 6 |
|
9 |
| -## Adding / Removing Navigation Items |
10 |
| -Currently Nav/Footer bars aren't abstracted so you'll need to individually update each page for an update. |
| 7 | +- Modern, responsive design using Tailwind CSS |
| 8 | +- Component-based architecture for better maintainability |
| 9 | +- Optimized build process for production |
| 10 | +- Development server with hot reloading |
| 11 | +- SEO optimizations and meta tag management |
| 12 | +- Automated asset optimization |
11 | 13 |
|
12 |
| -## Adding Pages |
13 |
| -To add a page, copy an existing page, like 'community.html' and use that as a reference for the overall layout. The pages are using TailWind CSS (https://tailwindcss.com/docs) as the implementation framework, so make sure to use utility-first primitives. |
| 14 | +## Prerequisites |
14 | 15 |
|
15 |
| -## Adding Page Content |
16 |
| -If simple updates are required, update the pages directly and use any utility-style CSS classes for your changes. If you need additional help, contact Michael Zephyr. |
| 16 | +- Node.js (v14 or higher) |
| 17 | +- npm (v6 or higher) |
| 18 | + |
| 19 | +## Getting Started |
| 20 | + |
| 21 | +1. Clone the repository: |
| 22 | + ```bash |
| 23 | + git clone https://github.com/Project-MONAI/project-monai.github.io.git |
| 24 | + cd project-monai.github.io |
| 25 | + ``` |
| 26 | + |
| 27 | +2. Install dependencies: |
| 28 | + ```bash |
| 29 | + npm install |
| 30 | + ``` |
| 31 | + |
| 32 | +3. Start the development server: |
| 33 | + ```bash |
| 34 | + npm run dev |
| 35 | + ``` |
| 36 | + |
| 37 | +The site will be available at `http://localhost:3000` with hot reloading enabled. |
| 38 | + |
| 39 | +## Project Structure |
| 40 | + |
| 41 | +``` |
| 42 | +project-monai.github.io/ |
| 43 | +├── components/ # Reusable HTML components |
| 44 | +├── assets/ # Static assets (images, CSS, JS) |
| 45 | +├── scripts/ # Build and optimization scripts |
| 46 | +├── src/ # Source files |
| 47 | +└── dist/ # Production build output |
| 48 | +``` |
| 49 | + |
| 50 | +## Components |
| 51 | + |
| 52 | +The website uses a component-based architecture. Common elements like headers, footers, and navigation are stored in the `components/` directory and included in pages using the include syntax: |
| 53 | + |
| 54 | +```html |
| 55 | +<!-- #include file="components/head.html" --> |
| 56 | +<!-- #include file="components/header.html" --> |
| 57 | +<!-- #include file="components/footer.html" --> |
| 58 | +<!-- #include file="components/scripts.html" --> |
| 59 | +``` |
| 60 | + |
| 61 | +## Development |
| 62 | + |
| 63 | +### Adding New Pages |
| 64 | + |
| 65 | +1. Create a new HTML file in the root directory |
| 66 | +2. Use the component includes for common elements |
| 67 | +3. Add your page-specific content |
| 68 | +4. Update meta tags using the head component variables: |
| 69 | + ```html |
| 70 | + <script> |
| 71 | + document.head.innerHTML = document.head.innerHTML |
| 72 | + .replace('${title}', 'Your Page Title') |
| 73 | + .replace('${description}', 'Your page description') |
| 74 | + .replace('${canonical_url}', 'https://monai.io/your-page.html'); |
| 75 | + </script> |
| 76 | + ``` |
| 77 | + |
| 78 | +### Modifying Components |
| 79 | + |
| 80 | +Components are located in the `components/` directory. When modifying a component: |
| 81 | +1. The change will automatically affect all pages using that component |
| 82 | +2. Test the changes across multiple pages to ensure consistency |
| 83 | +3. Run the development server to see changes in real-time |
| 84 | + |
| 85 | +### CSS Development |
| 86 | + |
| 87 | +The project uses Tailwind CSS with a custom configuration: |
| 88 | + |
| 89 | +1. Development: |
| 90 | + ```bash |
| 91 | + npm run watch |
| 92 | + ``` |
| 93 | + This will watch for changes and rebuild the CSS automatically. |
| 94 | + |
| 95 | +2. Adding new styles: |
| 96 | + - Add custom styles in `src/css/` |
| 97 | + - Configure Tailwind in `tailwind.config.js` |
| 98 | + - Custom classes can be added to `assets/css/` |
| 99 | + |
| 100 | +## Building for Production |
| 101 | + |
| 102 | +1. Build the site: |
| 103 | + ```bash |
| 104 | + npm run build |
| 105 | + ``` |
| 106 | + |
| 107 | +This will: |
| 108 | +- Process and include all components |
| 109 | +- Optimize images and assets |
| 110 | +- Minify CSS and JavaScript |
| 111 | +- Generate the production build in `dist/` |
| 112 | + |
| 113 | +## Deployment |
| 114 | + |
| 115 | +The site is automatically deployed to GitHub Pages when changes are pushed to the main branch. |
| 116 | + |
| 117 | +## Contributing |
| 118 | + |
| 119 | +1. Fork the repository |
| 120 | +2. Create a feature branch |
| 121 | +3. Make your changes |
| 122 | +4. Submit a pull request |
| 123 | + |
| 124 | +## License |
| 125 | + |
| 126 | +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. |
| 127 | + |
| 128 | +## Support |
| 129 | + |
| 130 | +If you need help or have questions: |
| 131 | +1. Open an issue in this repository |
0 commit comments