Skip to content

Instantly share code, notes, and snippets.

@codeadamca
Last active February 26, 2025 02:38
Show Gist options
  • Save codeadamca/bc3dcb6fc768ee1714918aa15cf13fad to your computer and use it in GitHub Desktop.
Save codeadamca/bc3dcb6fc768ee1714918aa15cf13fad to your computer and use it in GitHub Desktop.
Setting up your username.github.io page

Setting up your username.github.io Page

When you setup GitHub pages, by default your content is available at https://<GITHUB_USERNAMNE>.github.io/<REPO_NAME>/.

However, if you create a repo with the exact name <GITHUB_USERNAME>.github.io, GitHub will automatically turn GitHub Pages on, and make this content avialable at https://<GITHUB_USERNAME>.github.io/. Kind of like your GitHub home page!

For example, I set up a sample at:
https://github.com/codeadamca/codeadamca.github.io

The repo is avilable as a website at:
https://codeadamca.github.io

This also works for organizations using a repo named <GITHUB_ORGANIZATION>.github.io.

For example BrickMMO has a page at:
https://brickmmo.github.io/

This setup also has the added benefit that your <GITHUB_USERNAME>.github.io website is the root of your other websites using GitHub Pages. So you can place a favicon (or other shared root files) in your <GITHUB_USERNAME>.github.io repo and it will be used by sites such as https://<GITHUB_USERNAMNE>.github.io/<REPO_NAME>/.

This GitHub Pages site uses my favicon.ico file from my codeadamca.github.io site:
https://codeadamca.github.io/about-me/

@nicfv
Copy link

nicfv commented Oct 6, 2023

I can't create a pull request, but there is a minor typo here: 😃

Kind of like your GutHub home page!

@AS-EBaiden
Copy link

AS-EBaiden commented Mar 25, 2024

im curious, can we do something like this? [repo-name].[username].github.io ?

@tahayparker
Copy link

@AS-EBaiden did you figure it out? is it possible to do so?

im curious, can we do something like this? [repo-name].[username].github.io ?

@codeadamca
Copy link
Author

im curious, can we do something like this? [repo-name].[username].github.io ?

I do not think this is possible.

@AS-EBaiden
Copy link

☹ it is not possible

@HimalEranganaOfficial
Copy link

HimalEranganaOfficial commented Jan 8, 2025

I tried to set this up, but I wasn't able to get it working. Can someone please help me identify where I might be making a mistake?😔

My username is @HimalEranganaOfficial .

Here's the page I created: https://himaleranganaofficial.github.io/HimalEranganaOfficial/

However, it doesn't seem to be working at https://himaleranganaofficial.github.io/

@codeadamca
Copy link
Author

@HimalEranganaOfficial Change the name of the repo to "HimalEranganaOfficial.github.io" (include ".github.io" in the repo name). For example, here is mine:

https://github.com/codeadamca/codeadamca.github.io

You won't have to turn on GitHub Pages.

@HimalEranganaOfficial
Copy link

@codeadamca, thanks for clarifying that! (I asked it from several AIs and searched Stack Overflow questions, but I couldn't find a solution to my problem.)

I knew that creating a repo named "username" would display its README.md in the profile. That's why I thought the correct repo to put the index.html file in was there, since GitHub treats it specially (GitHub showed a special notification after I created it, mentioning editing README.md to display it in profile view).
image

By the way, thanks again for pointing me in the right direction. I really appreciate it! 😄

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