Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 7.6 KB

pages.md

File metadata and controls

92 lines (63 loc) · 7.6 KB

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors Visitors

🌟 Hit star button to save this repo in your profile

Github Pages

GitHub Pages is a static site hosting service provided by GitHub. It allows users to host static HTML, CSS, and JavaScript files for free, directly from a GitHub repository. GitHub Pages also allows for custom domains, HTTPS encryption, and Jekyll, a static site generator.

To use GitHub Pages, a user creates a new repository on GitHub and names it with the convention username.github.io. Then, they can upload their HTML, CSS, and JavaScript files to the repository and configure the repository settings to enable GitHub Pages. The user can choose to have the site hosted on a custom domain, or on the default username.github.io domain.

GitHub Pages also includes built-in support for Jekyll, a static site generator that can be used to create and manage content for a website. Jekyll uses templates and Markdown files to generate static HTML files, which can be hosted on GitHub Pages.

Overall, GitHub Pages is a simple and free solution for hosting static websites. It's ideal for personal sites, documentation, and small projects that don't require dynamic content or server-side processing.

Steps to create a GitHub Pages website

1. Create a new repository:

  • Log in to your GitHub account and click the "+" icon in the top right corner of the page.
  • Select "New Repository" from the drop-down menu.
  • Name your repository in the following format: username.github.io, where "username" is your GitHub username.

2. Upload your website files:

  • Upload your website files to the repository. You can do this using the GitHub website interface, or by using Git to push the files to the repository.
  • Your website files should include at least an index.html file, which will be the homepage of your website.

3. Enable GitHub Pages:

  • Navigate to the repository's "Settings" page.
  • Scroll down to the "GitHub Pages" section.
  • Select the branch that you want to use for your website (usually the "main" branch).
  • Click "Save".

4. Verify your website is live:

  • After you have enabled GitHub Pages, a green banner will appear at the top of the page, confirming that your website is live.
  • You can access your website at https://username.github.io.

5. Customize your website:

  • You can customize your website further by using a custom domain name, adding CSS styles, or using Jekyll to generate your website. That's it! Your GitHub Pages website is now live and accessible to the world.

Connect a GitHub repository to a GitHub Pages website:

  1. Create a new repository on GitHub with the name "username.github.io" (replace "username" with your GitHub username).
  2. Upload your website files to the repository.
  3. Ensure that you have an "index.html" file in the root directory of your repository. This file will be the main page of your website.
  4. Once you have your repository set up, go to your repository's settings page.
  5. Scroll down to the "GitHub Pages" section and select "master branch" or "main branch" as your source.
  6. Click "Save" and wait for a few minutes for GitHub to build your website.
  7. After the build process is complete, you will see a green message saying "Your site is published at https://username.github.io".
  8. Click on the link to view your website.

Connect three different GitHub repositories to a single GitHub Pages website:

  1. Create a new repository on GitHub with the name "username.github.io" (replace "username" with your GitHub username).
  2. Clone the repository to your local machine using Git.
  3. Create a new folder for each of your three repositories inside the cloned repository folder. For example, you can name the folders "repo1", "repo2", and "repo3".
  4. Clone each of the three repositories into their respective folders on your local machine.
  5. Copy the contents of the "index.html" file from each of the three repositories into the root directory of the cloned repository folder.
  6. Copy any other files (CSS, JavaScript, images, etc.) that your website needs from each of the three repositories into the root directory of the cloned repository folder.
  7. Push the changes to the "username.github.io" repository on GitHub.
  8. Go to your repository's settings page on GitHub.
  9. Scroll down to the "GitHub Pages" section and select "master branch" or "main branch" as your source.
  10. Click "Save" and wait for a few minutes for GitHub to build your website.
  11. After the build process is complete, you will see a green message saying "Your site is published at https://username.github.io".
  12. Click on the link to view your website, and you should be able to see all three repositories linked together in one GitHub Pages website.

Comparison GitHub and GitHub Pages

GitHub is a web-based hosting service for version control using Git. It provides a platform for software developers to collaborate on code projects and track changes to their codebase over time. GitHub offers a wide range of features and tools for managing code repositories, such as pull requests, issues, and wikis, making it a popular choice for software development teams.

On the other hand, GitHub Pages is a free web hosting service that allows you to publish a website or web application directly from your GitHub repository. With GitHub Pages, you can create a static website or host a dynamic web application using Jekyll, a popular static site generator, or any other framework or language that can run on the web.

The main difference between GitHub and GitHub Pages is that GitHub is primarily focused on code collaboration and version control, whereas GitHub Pages is designed for hosting websites and web applications. While GitHub allows you to store and manage your code repositories, GitHub Pages provides a platform for publishing and sharing your web content.

In summary, GitHub is a powerful tool for managing code repositories and collaborating on software development projects, while GitHub Pages is a simple and free way to host your website or web application directly from your GitHub repository. Depending on your needs, you may choose to use one or both of these services to manage your code and share your web content.

Contribution 🛠️

Please create an Issue for any improvements, suggestions or errors in the content.

You can also contact me using Linkedin for any other queries or feedback.

Visitors