Build & Publish Your First Website with AI

A Complete Beginner's Guide

Introduction

Welcome!

In this book, you'll learn how to create a professional one-page website using AI, edit it without coding, host it for free, and connect your own custom domain.

You do not need:

By the end of this book, you'll have a website that anyone can visit on the internet.


Chapter 1: What is a Static One-Page Website?

What is a Website?

A website is a collection of pages that people can visit through a web browser such as Chrome, Edge, or Firefox.

Examples:

Every website is made up of files that are stored on a server and delivered to visitors through the internet.


What is a One-Page Website?

A one-page website contains all information on a single page.

Typical sections include:

When visitors scroll down, they can see all sections without opening another page.


What is a Static Website?

A static website consists of files such as:

It does not require a database or complex backend.

Advantages:

For beginners and small businesses, static websites are perfect.


Chapter 2: Understanding Domain and Hosting

What is Hosting?

Hosting is the computer where your website files are stored.

When someone visits your website, the hosting server sends those files to their browser.

Think of hosting as the land where your website house is built.


What is a Domain?

A domain is the address people type to visit your website.

Examples:

Think of a domain as your home's address.


Domain vs Hosting

Domain = Address

Hosting = Land where the website lives

You need both to create a professional website.


Chapter 3: What is GitHub?

Understanding GitHub

GitHub is a free platform where you can store website files online.

We will use GitHub for:


Why Use GitHub?

Advantages:


Create a GitHub Account

Step 1:
Visit github.com

Step 2:
Click Sign Up

Step 3:
Choose:

Step 4:
Verify account

Step 5:
Login


Chapter 4: Creating Your First Repository

What is a Repository?

A repository is simply a folder stored online.

This folder will contain:


Create Repository

Step 1:
Click the "+" icon

Step 2:
Click "New Repository"

Step 3:
Enter repository name

Example:

my-website

Step 4:
Select Public

Step 5:
Click Create Repository

Repository created successfully.


Chapter 5: Creating Your Website with Gemini AI

What is Gemini?

Gemini is Google's AI assistant.

It can generate complete websites from a simple prompt.


Opening Gemini

Visit Gemini.

Login with your Google account.


Prompting Gemini

Use this prompt:

Create a modern responsive one-page website for a restaurant.

Requirements:

Return everything in a single index.html file.


Copying the Generated Code

Gemini will generate HTML.

Copy all code.


Creating index.html

Open Notepad.

Paste the code.

Save file as:

index.html


Testing Website

Double-click index.html.

The website opens in your browser.

Congratulations!

Your website is working locally.


Chapter 6: Uploading Website Files to GitHub

Uploading index.html

Open your repository.

Click Add File.

Select Upload Files.

Upload:

Click Commit Changes.


Uploading Images

Create folder:

src

Inside src upload:

Commit changes.


Repository Structure

Your project should look like:

index.html

src/

logo.png

banner.jpg

image1.jpg

image2.jpg


Chapter 7: Editing Website Content in GitHub

Editing Text

Open:

index.html

Click Edit

Find:

Business Name

Replace with your own business name.


Editing Phone Number

Replace:

9876543210

with your number.


Editing Address

Replace with your address.


Saving Changes

Click Commit Changes.

GitHub automatically saves the update.


Chapter 8: Adding and Replacing Images

Upload New Images

Open Repository.

Click Add File.

Upload File.


Replace Existing Images

Upload image with same filename.

Example:

old:

banner.jpg

new:

banner.jpg

The website updates automatically.


Best Image Sources

Download free professional images.


Chapter 9: Publishing Website with GitHub Pages

What is GitHub Pages?

GitHub Pages turns your repository into a live website.


Enable GitHub Pages

Open Repository Settings.

Click Pages.

Under Source:

Select:

Deploy from Branch

Choose:

main

root

Click Save.


Your Website is Live

GitHub will generate a URL.

Example:

username.github.io/my-website

Open it in browser.

Your website is now online.


Chapter 10: Connecting a Custom Domain

Why Use a Custom Domain?

Instead of:

username.github.io/my-website

Use:

mybusiness.com

This looks professional.


Purchase a Domain

Buy a domain from:


Add Custom Domain in GitHub

Open:

Settings → Pages

Enter:

mybusiness.com

Save.


Configure DNS

Add required records at your domain provider.

GitHub will provide the DNS information.

Add:


Verify Domain

Wait for DNS propagation.

Usually takes a few minutes to 24 hours.


Enable HTTPS

GitHub automatically provides SSL.

Enable:

Enforce HTTPS

Your website is now secure.


Final Congratulations

You have successfully:

You now have the skills to create websites for yourself, friends, clients, or local businesses.