Giter Site home page Giter Site logo

learngithubpages's Introduction

How to Host an HTML File on GitHub Pages

This guide will walk you through the process of forking a repository containing an HTML file and then hosting it using GitHub Pages.

Prerequisites:

  • A GitHub account. If you don't have one, sign up for free.

Steps:

1. Fork the Repository

  • Navigate to the repository you wish to fork on GitHub.
  • Click on the 'Fork' button at the top right corner of the page. This will create a copy of the repository in your GitHub account.

2. Set up GitHub Pages

  • Navigate to your forked repository on the GitHub website.
  • Go to the 'Settings' tab, located at the top-right corner of the page.
  • Scroll down to the 'Pages' section.
  • Under 'Branch', select the branch you want to use for GitHub Pages (change None to main).
  • Click 'Save'.
  • Wait a few minutes for your page to be deployed.

3. Access Your Hosted HTML File

  • Refresh the page and you will find a link to your hosted page at the top.
  • After configuring GitHub Pages, GitHub will provide you with a link to your live site. It usually looks something like: https://yourusername.github.io/forked-repo-name/

4. Editing Files

  • Since you have already hosted your website via GitHub pages, let's edit it and view it live.
  • For this open the /index.html file and edit the text Github Pages in line number 96 to Github Page by [Your Name].
  • Once you have edited the file, click on the commit changes button on the top right of the editor to commit your changes.
  • Enter a commit message and click commit changes once again to confirm your changes.
  • Now, within a few minutes, your edit will be visible on the website.

Conclusion

That's it! You have successfully forked a repository and hosted an HTML file using GitHub Pages without cloning locally. Enjoy your live site!

Sample Message

#ge-learn-ghpages

Hey, I have completed the Learn Github Pages task, and here is the hosted link to my task. Hosted Link: https://yourusername.github.io/forked-repo-name/

learngithubpages's People

Contributors

jenin82 avatar ecoholic84 avatar aswinasok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.