GitHub Pages Foundations
GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files directly from a repository on GitHub.
Configuration
- Source Selection: Go to
Settings > Pagesto choose the branch and folder (/rootor/docs) to deploy from. - Custom Domains: Point your own domain to GitHub's servers by adding a
CNAMEfile and configuring your DNS provider.
Routing Strategies
- Folder Structure: Direct mapping of repository paths to URLs.
- SPA Hack: Using a
404.htmlpage to redirect all traffic toindex.htmlfor single-page applications.
Best Practices
- HTTPS Enforcement: Always enable "Enforce HTTPS" in repository settings.
- Minimal Dependencies: Use as few external assets as possible to ensure fast loading and high compatibility.