Github pages don't like relative links

I have relative links in development.md and all links are on the same site.

For example:

* [Scripts](#scripts)
##Scripts
here commes an lot of text

      

After clicking on github, the links work. Then I pushed the site to Github Pages and links no longer work.

On Github I can see the path in the browser https://github.com/name/project/blob/master/docs/development.md#scripts

On the Github pages I can see this path in the browser http://ux.example.com/#scripts

How can I solve this problem? I don't use Jekyll.

I got this answer from github. Since this is a React application and not something to do with the GitHub pages, I'm not sure how much we can support it. However, it looks like whatever router you use to customize your page can get confusing. Since your router uses the # symbol, I believe it is trying to change the page, but there is no page for #scripts. Finally, it looks like your scripting section is missing the id = "scripts" required for the anchor links to work.

I found this solution

The solution is very simple
* [Scripts](#scripts)


##Scripts <a id="scripts"></a>
here commes an lot of text

      

+3


source to share





All Articles