hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
979 stars 567 forks source link

Feature Request: support custom domains #953

Open maiani opened 3 weeks ago

maiani commented 3 weeks ago

I have tried to set up a custom domain for a personal GitHub page. It works smoothly but I noticed some SEO problems because of the duplicate content at username.github.io and customdomain.com

The internet suggests the following solution: add to the head

<meta http-equiv="refresh" content="0; URL=https://customdomain.com/">
<link rel="canonical" href="https://customdomain.com/">

I considered modifying just my fork of the theme, but I am now wondering if there are other places where the custom domain should be added.

It is also unclear why there are two different parameters for the site URL: baseURL in hugo.yaml and openGraph.url. Is there any case where they should differ from each other?

Since this may be a common situation, adding an option to the theme to support custom domains may be worth adding.