Skip to content

Instantly share code, notes, and snippets.

@dipaish
Last active December 18, 2023 11:43
Show Gist options
  • Save dipaish/a2c1d846c79e518981e19271b9efa828 to your computer and use it in GitHub Desktop.
Save dipaish/a2c1d846c79e518981e19271b9efa828 to your computer and use it in GitHub Desktop.
HTML5 and GitHub Pages[object Object]

Exercise 2: HTML5 & GitHub Pages

Task 1: Hosting Your Webpage

After creating your web pages locally, the next step is to publish them so that they are accessible to the public. You have many options for publishing such as hosting services, cloud solutions, set up your own web servers or use Github pages.

In this course, we'll utilize GitHub Pages for publishing your tasks and project work. This exercise guides you through using GitHub Pages to publish your HTML pages.

Note: At this point, you've successfully completed Exercise 1 and set up a directory structure for your exercises. Now, proceed with the following steps:

Activity 1: Add Local Repository to Your GitHub Account

  1. Open GitHub Desktop and select "Add Local Repository."
  2. Choose the folder on your computer where Exercise 1 is located and click "Add repository."
  3. Click "Publish Repository."

Activity 2: Enable GitHub Pages

  1. Open your GitHub repository on the GitHub website.
  2. Click on the "Settings" tab.
  3. Scroll down to the "GitHub Pages" section.
  4. In the "Source" dropdown, select "main branch" (or another branch if you prefer).
  5. Click "Save."

Activity 3: Verify Your Website

  1. Scroll back down to the "GitHub Pages" section.
  2. After a few moments, you'll see a message saying "Your site is ready to be published at" followed by a URL (e.g: https://yourusername.github.io/repositoryname/).
  3. Visit this URL to verify that your HTML pages are successfully published.

Your website is now hosted using GitHub Pages and is publicly accessible on the internet. Any changes made to your local repository will automatically be reflected on your website.

Keep in mind that GitHub Pages may take a few minutes to reflect changes after you push updates to your repository.

Task 2: Re-create Exercise 1

At this point, we have already created a couple of simple HTML files: index.html and exercise1.html. We'll now transition to using HTML5 for our web pages.

In this task, you will be doing the same steps as in Exercise 1 but by using HTML5 and semantic elements for a more modern and structured approach. Conduct the following steps:

Note: Since you're publishing from the main branch, your website is automatically updated and shared with everyone whenever you push updates to your main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment