A Python-based static site generator that reproduces the European Mobility Symposium website using Jinja2 templates and Bootstrap 5.
- Python 3.8 or higher
- Git (for deployment)
- Clone this repository:
git clone https://github.com/username/european-mobility-symposium.git
cd european-mobility-symposium- Install dependencies:
pip install -r requirements.txt- Build the website:
python build.py- Open
output/index.htmlin your browser to view the site.
# Build the site
python build.py
# Build and serve locally
python build.py --serve
# Build and serve on custom port
python build.py --serve --port 8080# Build and serve with auto-reload during development
python build.py --serve# Deploy to GitHub Pages (requires git setup)
python build.py --deployeuropean-mobility-symposium/
βββ build.py # Main build script
βββ config.yaml # Site configuration
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ content/ # Content files
β βββ symposium.yaml # Symposium data
βββ templates/ # Jinja2 templates
β βββ index.html # Main template
βββ assets/ # Static assets
β βββ css/
β β βββ style.css # Custom CSS
β βββ js/
β βββ main.js # Custom JavaScript
βββ output/ # Generated site (created after build)
βββ .github/
βββ workflows/
βββ gh-pages.yml # GitHub Actions workflow
Edit config.yaml to customize:
- Site title and description
- Bootstrap theme
- Social media links
- Navigation menu
Edit content/symposium.yaml to update:
- Event details (dates, venue, location)
- Participant list
- Organizer information
- Program information
The main template is in templates/index.html. It uses Jinja2 templating:
{{ variable }}for simple variables{% for item in items %}for loops{% if condition %}for conditionals
Custom CSS is in assets/css/style.css. The site uses:
- Bootstrap 5.3.0 from CDN
- Font Awesome 6.4.0 for icons
- Custom CSS for additional styling
Custom JavaScript is in assets/js/main.js and includes:
- Smooth scrolling navigation
- Active navigation highlighting
- Card hover effects
- Mobile menu handling
- Push your code to a GitHub repository
- Go to repository Settings > Pages
- Set source to "GitHub Actions"
- The included workflow will automatically build and deploy
# Build the site
python build.py
# Deploy to gh-pages branch
python build.py --deployThe generated output/ folder contains a complete static website that can be hosted on:
- Netlify
- Vercel
- AWS S3
- Any web server
Create additional templates in the templates/ folder and render them in build.py:
generator.render_page(
template_name="custom.html",
output_name="custom.html",
context={"custom_data": data}
)Add multiple pages by creating new templates and updating the build script:
# In build.py build() method
self.render_page("about.html", "about.html", context)
self.render_page("contact.html", "contact.html", context)Add new content files in content/ directory:
- JSON files:
content/speakers.json - YAML files:
content/schedule.yaml - Markdown files: Process with additional libraries
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test the build:
python build.py - Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Original website: European Mobility Symposium 2024
- Built with Python
- Templates powered by Jinja2
- Styled with Bootstrap 5
- Icons from Font Awesome
If you encounter any issues:
- Check the Issues page
- Create a new issue with detailed information
- Include your Python version and operating system
To update the site content:
- Edit
content/symposium.yaml - Run
python build.py - Commit and push changes (auto-deployment will handle the rest)
Built with β€οΈ using Python and Bootstrap