Host Multiple Projects Using GitHub Pages with USERNAME
This guide outlines the process of using ** GitHub Pages** as the main repository for hosting multiple projects under a single GitHub Pages site. This approach is ideal for developers wanting a cohesive, organized way to showcase their projects within one domain.
Overview
GitHub Pages makes it possible to host and display multiple projects, each with its own unique features, under one central site. This guide will help you set up ** GitHub Pages** to display your projects with an easy-to-navigate structure that is scalable for future additions.
Key Features of Multi-Project GitHub Pages Hosting
- Multi-Project Display: Host multiple projects under a single GitHub Pages site.
- Easy Navigation: Each project has a dedicated section, making it simple for users to explore each one.
- Consistent Domain: Using a single domain (
https://<username>.github.io
) simplifies access and organization.
- Modularity and Scalability: Add or update projects without disrupting the structure.
Getting Started with Multi-Project Hosting
To add a new project to your GitHub Pages site:
- Create a New Directory: Add a directory within the main repository for each project.
- Add Project Files: Include all necessary files for each project (HTML, CSS, JavaScript).
- Update Main Navigation: In
index.html
or your main navigation file, add links and descriptions for each project.
- Edit the README: Optionally, update the README to include an overview of each new project for easy reference.
Example Directory Structure
<username>.github.io/
├── index.html # Main homepage
├── Project1/ # Project 1 directory
│ ├── index.html
│ ├── assets/
│ └── ...
├── Project2/ # Project 2 directory
│ ├── index.html
│ ├── assets/
│ └── ...
└── README.md # README file
Hosting a Flutter Web Project on GitHub Pages
To host a Flutter web project under ’s GitHub Pages, follow these steps:
Step-by-Step Guide to Hosting a Flutter Web Project
- Create a Flutter Project and GitHub Repository: Start with a Flutter project and a new GitHub repository.
- Complete Your Flutter App: Ensure your app functions as expected.
- Upgrade Flutter: Run
flutter upgrade
to update to the latest version.
- Enable Web Support:
flutter config --enable-web
- Recreate Project:
- Build Your Web App:
- Modify
index.html
: In build/web
, remove <base href="/">
to fix routing issues.
- Commit and Push to GitHub: Add your files to your GitHub repository.
- Configure GitHub Pages:
- Go to Settings > Pages in your repository.
- Choose your source branch (e.g.,
main
).
- Deploy Your Project: Once GitHub builds and deploys, access your live site at your GitHub Pages URL.
Example Projects on GitHub Pages
- Project 1: Description and link to
https://<username>.github.io/Project1/
.
- Project 2: Description and link to
https://<username>.github.io/Project2/
.
- Easily add more projects by following the directory structure.
License
This repository and its projects are open-source under the MIT License.
For a live demo and more details, visit on Postboxat18 GitHub Pages
FlutterBootstrap.