Skip to main content

Command Palette

Search for a command to run...

Hosting a Static Website with GitHub Pages

Published
โ€ข2 min read

This documentation explains how to deploy a static website using GitHub Pages. The project includes a simple HTML, CSS, and JavaScript website that displays a real-time digital clock.


๐ŸŽฏ Objective

  • Create a static website using HTML, CSS, and JavaScript.

  • Host the site for free using GitHub Pages.

  • Verify deployment with screenshots of key steps.


๐Ÿ›  Tools Used

  • GitHub โ€“ version control and hosting

  • GitHub Pages โ€“ free static site hosting

  • HTML, CSS, JavaScript โ€“ web development stack


๐Ÿ“‚ Project Structure

โ”œโ”€โ”€ index.html      # Homepage with clock container
โ”œโ”€โ”€ style.css       # Stylesheet for layout and design
โ””โ”€โ”€ script.js       # Script to update the digital clock

๐Ÿš€ Step-by-Step Process

1๏ธโƒฃ Create the Website Files

  • index.html contains the structure of the page.

  • style.css adds styling.

  • script.js handles clock functionality.


2๏ธโƒฃ Push Files to GitHub

  • Initialize Git in your local project folder.

  • Connect your GitHub repository.

  • Push the files to the main branch.

image


3๏ธโƒฃ Enable GitHub Pages

  • Open your repository on GitHub.

  • Navigate to Settings โ†’ Pages.

  • Select the main branch and root folder.

  • Save changes.

image


4๏ธโƒฃ Access Your Live Website

  • GitHub generates a link in this format:

      https://<username>.github.io/<repo-name>/
    

image


โœจ Features of the Website

  • Displays a real-time digital clock that updates every second.

  • Simple, modern design with responsive layout.

  • Hosted 100% free on GitHub Pages.


๐Ÿ”ฎ Future Enhancements

  • Add dark/light mode toggle.

  • Display the current date along with time.

  • Improve styling with animations.