Skip to main content

Set up your domain name

The platform in this instruction is GitLab, and I will demonstrate the domain name registrar with Namecheap.

Steps

  1. Purchase a domain name on Namecheap

  2. Register the name domain name on Gitlab

    1. Go to your repository, and choose the Page option in the Setting area. And then click the New Domain.
    2. Type your new domain new. If you do not have your SSL certificate, then we can let Gitlab help us to apply automatically.
    3. Gitlab will give you a number (Verification status) to verify this new domain name. We will use it on the setting page of our domain registrar (Namecheap).
  3. Verify the name domain on Namecheap

    1. Let's go to the management area of your domain name. We choose "Advanced DNS"

    2. We need to add a TXT Record to verify the status. We can get the number from the Verification status of last step.

      For example:

      _gitlab-pages-verification-code.test.com TXT gitlab-pages-verification-code=04971d8ba6e33653bc515164213

      We need to copy the words gitlab-pages-verification-code=04971d8ba6e33653bc515164213 in the Value place of the TXT Record. (You can check on my image.)

    3. We also need to add the Gitlab IP in Namecheap by A Record. Choose A Record and the value is 35.185.44.232. In this step, it is the same value if you are using Gitlab.

    4. Wait for a little bit. Go back to the page of Gitlab. Refresh the button until it shows Verified.

  4. Amend the url and baseUrl in your code. We need to change the url in the docusaurus.config.js file.

    docusaurus.config.js
    module.exports = {
    title: 'Chieh',
    tagline: 'Code Once, Live Once.',
    url: 'https://(your name domain name)',
    baseUrl: '/',

In the beginning, you only have HTTP with your website because Gitlab is still in the stage of applying the SSL certificate. Hence, we just need to wait for a little bit, and then come back later.

You will notice that your website will be applied with HTTPS automatically soon.

Reference