Gh Pages Foundations

Configuring and managing static hosting for documentation and portfolios.

jcorpac 6aa86fe 952 B Updated

File contents

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 > Pages to choose the branch and folder (/root or /docs) to deploy from.
  • Custom Domains: Point your own domain to GitHub's servers by adding a CNAME file and configuring your DNS provider.

Routing Strategies

  • Folder Structure: Direct mapping of repository paths to URLs.
  • SPA Hack: Using a 404.html page to redirect all traffic to index.html for 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.

jcorpac/ai-skills-library/tree/main/ops/gh-pages-foundations commit 6aa86fe8a5

Frequently asked questions

npx skillmds@latest add jcorpac/gh-pages-foundations