Q:

Links issue when I deploy my Hugo site as a Github Pages project

I created a Hugo site that working well locally.  I deployed my Hugo site as a Github Pages project via a /docs folder on the master branch.  
So now, I have my Github Page project and my URL looks like that: 
https://myname.github.io/myrepository/myHugoSite. 
I have a problem with my link.  All my links redirect to https://myname.github.io/ but not https://myname.github.io/myrepository/ because my links are /next-page/. These links are working locally because I don't have a repository.  
My question is: Do I have to add /myrepository/ to all my links or there is another solution? 

A:

You need to add your site prefix to the baseUrl parameter in the config file.  In your case the prefix is myrepository/
If you are using TOML format in your config file it would look like this:
baseUrl = "https://myname.github.io/myrepository/"

