Github Pages don't like relative links

Viewed 99

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

For example:

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

After pushing to github, the links works. Then I pushed the site to Github Pages and the links don't work anymore.

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

On Github Pages I 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. As this is a React app, and not something to do with GitHub Pages, I'm not sure how much we will be able to support it. However, it looks like whatever router you're using to configure your page may be getting confused. Because your router is using a # character I believe it's trying to change the page, but no page for #scripts exists. Finally, it looks like your scripts section is missing the id="scripts" required to make anchor links work.

I found this solution

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


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