How do I link pages in GitHub Pages

Viewed 2581

Essentially I am trying to link to my my GitHub Pages index.html file to the other files in the repository to make a multi page website.

The URL is correct, I have tried a bunch of ways and I am simply getting no where. The main branch is called home, in it is the index.html file, as well as the other files, see below:

Main Branch is called home

The links inside the html file are:

<li class="masthead__menu-item">
          <a href="https://xxx.github.io/home/research/">Research</a>
        </li>

The file "research" is inside the home branch. I have tried naming it "research.html" I have tried deleteing the "home" from the above link so it directly links to research, see below:

<li class="masthead__menu-item">
          <a href="https://xxx.github.io/research/">Research</a>
        </li>

Nothing seems to work. What am I doing wrong?

3 Answers

After hours and hours of trying things, I finally got it to work:

       <li class="masthead__menu-item">
          <a href="xxx.github.io/research.html">Research</a>
        </li>

What I did was to get rid of the "home" and make the page an html file. Thank you iamabdm and minwka!

Looking at the screenshot and the html you provided, I don't see any *.html extensions following the name of the files you're trying to link to.

For example: try renaming the file "research" to "research.html"

If the file is a html file then the problem is with the address of the URL i.e. https://xxx.github.io/research/ in <a href="https://xxx.github.io/research/">Research</a>.

The last slash is causing the problem. Remove the last slash from the address, i.e. https://xxx.github.io/research and it will be <a href="https://xxx.github.io/research">Research</a>.

Related