Should I choose my GitHub username or my repository name as my JS.ORG subdomain?

Both are allowed. The choice depends on how your existing GitHub Pages URL is structured, and on which name better represents the site you are publishing.

JS.ORG accepts a subdomain that matches either the username or the repository name in your GitHub Pages URL. For a page at http://foo.github.io/bar, either foo.js.org or bar.js.org is possible. Once you pick one, that exact name has to appear in your CNAME file and in your pull request.

How the GitHub Pages URL maps to your options

GitHub Pages URLs follow the pattern username.github.io/repo. JS.ORG draws its allowed subdomains from the two name segments in that URL.

Your GitHub Pages URL Possible JS.ORG subdomains
foo.github.io/bar foo.js.org or bar.js.org
foo.github.io (user site) foo.js.org

For a user site (username.github.io with no repository path), the username is the only segment available, so the subdomain choice is effectively made for you.

When the username is the better pick

  • The site is personal — a portfolio, blog, or profile — rather than a single project.
  • You plan to host several projects under one identity and want one recognizable address.
  • Your username is short, memorable, and already how people find you on GitHub.

A username-based subdomain stays meaningful even if you rename or replace the underlying repository later, since the address points at you rather than at one project.

When the repository name is the better pick

  • The site is a single project, library, or tool with its own name.
  • The repository name is more descriptive than your username (for example, a library called bar under a generic username).
  • You want the URL to read like the product, not like the author.

A repository-based subdomain is the natural fit when the project name is the thing people will search for or share.

What to weigh before deciding

  • Recognizability. Which name will someone remember after seeing it once?
  • Fit with the topic. Does the name signal what the page is about?
  • Consistency. The name you choose must match in three places: the CNAME file, the pull request, and the domain you actually want. A mismatch is a common reason a request stalls.
  • Conflicts. Names are not guaranteed to be free. If your first choice is already taken, the other segment from your URL is your built-in fallback.

The step that locks in your choice

After deciding, add a file named CNAME to your repository — in the gh-pages branch for project pages — containing a single line with the chosen domain, for example foo.js.org without quotes. Then open a pull request in the JS.ORG GitHub repository adding your subdomain to the list of existing domains. Your new URL should go live within 24 hours, so keep an eye on the pull request in case of a naming conflict or a question from the JS.ORG side.

If you are unsure, the repository name is usually the safer default for a project site, and the username for a personal site. Either way, the decision is reversible only by going through the process again, so pick the name you would be happy to keep.

js.org
Dedicated to JavaScript and its awesome community since 2015