A simple, responsive website built with HTML and CSS, designed to be deployed on GitHub Pages.
- Clean, responsive design
- Modern CSS with gradient backgrounds
- Smooth scrolling navigation
- Mobile-friendly layout
- Easy to customize and extend
Once deployed, your website will be available at: https://[your-username].github.io/[repository-name]
test-project/
├── index.html # Main HTML file
├── styles.css # CSS styling
└── README.md # This file
-
Push your code to GitHub (if not already done):
git add . git commit -m "Add simple GitHub Pages website" git push origin main
-
Enable GitHub Pages:
- Go to your repository on GitHub
- Click on Settings tab
- Scroll down to Pages section in the left sidebar
- Under Source, select Deploy from a branch
- Choose main branch and / (root) folder
- Click Save
-
Access your website:
- GitHub will provide a URL like:
https://[your-username].github.io/[repository-name]
- It may take a few minutes for the site to be available
- GitHub will provide a URL like:
-
Create
.github/workflows/pages.yml
:name: Deploy to GitHub Pages on: push: branches: [ main ] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./
-
Push the workflow file and your site will auto-deploy on every push.
To test your website locally:
-
Simple HTTP Server (Python):
# Python 3 python -m http.server 8000 # Python 2 python -m SimpleHTTPServer 8000
Then open
http://localhost:8000
-
Live Server (VS Code Extension):
- Install the "Live Server" extension
- Right-click on
index.html
- Select "Open with Live Server"
-
Node.js http-server:
npx http-server
Edit the CSS variables in styles.css
:
- Header gradient:
linear-gradient(135deg, #667eea 0%, #764ba2 100%)
- Accent colors:
#667eea
and#764ba2
- Modify sections in
index.html
- Add new pages by creating additional
.html
files - Update navigation links in the header
- Create an
images/
folder - Add your images to the folder
- Reference them in HTML:
<img src="images/your-image.jpg" alt="Description">
The website includes responsive design features:
- Mobile-friendly navigation
- Flexible grid layout
- Scalable typography
- Touch-friendly buttons
To use a custom domain:
-
Create a
CNAME
file in the root directory with your domain:yourdomain.com
-
Configure DNS records with your domain provider:
- Add a CNAME record pointing to
[your-username].github.io
- Add a CNAME record pointing to
-
Update GitHub Pages settings to use your custom domain
Site not loading?
- Wait 5-10 minutes after enabling GitHub Pages
- Check that
index.html
is in the root directory - Verify the repository is public (or you have GitHub Pro for private repos)
Changes not showing?
- Clear browser cache
- Wait a few minutes for GitHub to rebuild the site
- Check the Actions tab for build status
Custom domain issues?
- Verify DNS propagation (can take up to 24 hours)
- Check CNAME file format (no
http://
orhttps://
)
This project is open source and available under the MIT License.
Feel free to fork this project and submit pull requests for improvements!