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
javascript github reactjs github-pages


source to share


No one has answered this question yet

Check out similar questions:

3953
What value of "href" should be used for JavaScript references, "#" or "javascript: void (0)"?
3303
How do I update a forked GitHub repository?
2245
How do I refresh the page using jQuery?
2170
How can I change the url without reloading the page?
1760
Is there a way to cache GitHub credentials for pushing commits?
1596
Add images to README.md on GitHub
1567
How do I remove a commit on GitHub?
693
Link to issue number in GitHub in commit post
497
Link and execute external JavaScript file hosted on GitHub
453
GitHub relative link in Markdown file



All Articles
Loading...
X
Show
Funny
Dev
Pics