Recently, I purchased a custom domain from domain.com and updated the DNS settings to point it to my GitHub Pages. In the DNS settings, aside from the four A
records, I added a CNAME record with the name www,
pointing to my GitHub Pages URL (username.github.io
).
Before the domain redirection, my GitHub Pages homepage loaded correctly, both locally and via the GitHub Pages URL (username.github.io/repository
).
However, after setting up the custom domain, I encountered issues with the homepage’s styling.
In my _config.yml
file, I set baseurl: ""
and the url
to my custom domain. In the _build_config.yml
file, I have the following configuration:
url: "https://username.github.io"
baseurl: "/repository_name"
destination: "docs"
In the assets folder, inside main.scss
, I have $baseurl: "{{ site.url }}{{ site.baseurl }}";
Additionally, in the CNAME
file, I added my purchased domain from domain.com
. I committed and pushed all the changes to GitHub
. However, when I open my custom domain, the styles from main.scss are not applied.
Any suggestions would be helpful!
1