简体   繁体   中英

The navigation buttons for pages on a forked and edited GitHub website no longer work

The navigation buttons on a GitHub hosted website don't take me to the page, and I am unsure how to fix it.

I am very new to GitHub, but am looking to make a webpage for the lab I work in. I found an existing lab webpage ( https://github.com/KordingLab/KordingLab.github.io ) that allows you to make forks and edit it for your own purposes, which was a great base. I've since changed the repository name but now when I load the page, the navigation buttons don't go to the pages automatically. My website name is myusername.github.io/repository , while when I click the "people" page navigation button, it tries to go to myusername.github.io/people which doesn't exist.

I can manually type in myusername.github.io/repository/people , and the page will come out. Obviously along the way of changing in my teams name while editing, I have messed this up a bit.

The outlay of the original website is kordinglab.com/people , which doesn't include the repository name which is why I think it won't navigate to include the repository. I've had a look through the code, but as I am a bit inexperienced, I can't find how to change it, or where it is controlled.

How can I fix it so the nav buttons actually go to the pages?

https://github.com/KordingLab/KordingLab.github.io provides all the code used in the original and working version. I would be more specific if I knew which file I was looking for, sorry.

Normally we require code to be included in your question. Having to go off-site to read code significantly limits how helpful questions can be to future readers.

However, in this case I think we can give a helpful answer without leaning too hard on that code. It's really an answer about how to find what you're looking for.

In this case, you want o find something that defines a link to people , or something like it. You can use GitHub's search to search for that value . Alternatively, you can use your text editor's search.

Either way, among your results you should see a file called _config.yml that contains, among other things, a section that looks like this:

# Navigation
nav:
  - name:           "home"
    href:           "/"
  - name:           "about"
    href:           "/about"
  - name:           "publications"
    href:           "/publication"
  - name:           "people"
    href:           "/people"
  - name:           "blog"
    href:           "/blog"

The href s here likely control the target of the named links in your site navigation. Update them to prefix /repository , redeploy, and you should be all set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM