codex-lv2-may-2025

Navigation

1 | 2 | 3 | Current Level: 4 | 5 | 6 | 7 | 8 | 9


Lesson: Creating an index.html File on GitHub

Objective:

Learn how to create and edit an index.html file directly on GitHub’s web interface. This will be your website’s homepage.

Prerequisite:

You should have already created a repository with a README file, as covered in the previous lesson.

Steps:

  1. Navigate to Your Repository

    • Go to your repository on GitHub.
  2. Add a New File

    • Click the “Add file” button, then select “Create new file”.
    • In the file name field, type index.html.
  3. Write HTML Content

    • In the editor box, write a simple HTML structure like this:
<!DOCTYPE html>
<html>
<head>
  <title>My Web Page</title>
</head>
<body>
  <h1>Welcome to My Website</h1>
  <p>This is my first HTML file on GitHub.</p>
</body>
</html>
  1. Commit the New File

    • Below the editor, write a short commit message such as “Add index.html with basic structure.”
    • Select “Commit directly to the main branch”.
    • Click “Commit new file”.

Practice Activity:

Tip:

Once you’ve added your index.html, you can enable GitHub Pages in the repository settings to view your site live!