selwynpolit / d9book

Drupal at your Fingertips: A developers quick reference for Drupal 9 and 10
https://www.drupalatyourfingertips.com
Creative Commons Attribution 4.0 International
186 stars 124 forks source link

Custom domain #128

Open selwynpolit opened 3 months ago

selwynpolit commented 3 months ago

In trying to setup a custom domain: www.drupalatyourfingertips.com, I've hit a few snags

Following the instructions at: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain-and-the-www-subdomain-variant It suggests: Note: Setting up a www subdomain alongside an apex domain is recommended for HTTPS secured websites.

I've setup the CNAME record and the apex domain so I get

dig +short www.drupalatyourfingertips.com CNAME selwynpolit.github.io.

dig +short drupalatyourfingertips.com A 185.199.111.153 185.199.109.153 185.199.110.153 185.199.108.153

This seems sane but somehow when I try to set the domain as www.drupalatyourfingertips.com Github barfs and reports:

DNS check unsuccessful Both drupalatyourfingertips.com and its alternate name are improperly configured Domain does not resolve to the GitHub Pages server. For more information, see documentation (NotServedByPagesError).

@maks-oleksyuk Any thoughts on this?

selwynpolit commented 3 months ago

https://www.whatsmydns.net/#CNAME/www.drupalatyourfingertips.com reports the info has propagated to most places but a few still missing

https://www.whatsmydns.net/#A/www.drupalatyourfingertips.com Reports it is everywhere

selwynpolit commented 3 months ago

ok, I got it no longer complaining about the DNS check but now the site is all kinda goofy! I wonder if there is some hardcoded reference to github.com in the styling stuff...

selwynpolit commented 3 months ago

ok, changed the base in config.mjs and that seems to have fixed it.

maks-oleksyuk commented 3 months ago

@selwynpolit Everything seems to be working well, are there any other possible questions?

After changing the domain, you will need to update the link to the site on the GitHub repository page as well as in the README file.

An interesting thing that I noticed is that after changing the base in the configuration, forks running on github domains may be affected. I think this should be noted somewhere.

selwynpolit commented 3 months ago

Thanks @maks-oleksyuk I got those changes but I don't quite know what to put about the forks running on github domains. How are they affected? What do you suggest I write about that? Are you thinking it is something for the README?

Do you think we need to do anything with this? https://github.com/selwynpolit/d9book/pull/127

maks-oleksyuk commented 3 months ago

Changing the key in the base will cause the site to work incorrectly on github domains (see my fork). To test the site, you will need to change the base to the name of the repository (usually d9book). I think it would be good to indicate this on the contribute page. Not everyone will deploy the site, but it will still be useful to have this information for those who want to do it.

You also need to specify that PRs should not change the base, so as not to break the deployment.