Hugo: Support Github README style Markdown relative links

Created on 4 Mar 2016  路  5Comments  路  Source: gohugoio/hugo

Currently Hugo uses relref and such for linking between posts. This doesn't work on Github and other editors. Github and other editors such as MacDown support relative markdown links such as [link name](file.md).

https://github.com/blog/1395-relative-links-in-markup-files

In order to support this Hugo would have to rewrite the links for .md files to .html or which ever pretty URL is configured. This is an example rewriting links for Jekyll:

https://github.com/github/pages-gem/issues/69#issuecomment-85481397

If this isn't desired for all of Hugo how hard would it be do this through a plugin?

Most helpful comment

Hi there, I'm sorry this is a old thread, but since the solution here was deprecated, is there any other solution to convert md relative links to html/hugo links? Something like jekyll does with it github plugin. Like @stevemoser said the idea is that it can still work in github repo view

thanks

All 5 comments

We actually do, but I'm not sure it's in the released version. I also suspect it needs some documentation, but you should find some info if you search the issue / pull requests here.

@bep What should I search for? I've browsed around some and couldn't find anything.

Added #1958

Hi there, I'm sorry this is a old thread, but since the solution here was deprecated, is there any other solution to convert md relative links to html/hugo links? Something like jekyll does with it github plugin. Like @stevemoser said the idea is that it can still work in github repo view

thanks

I think this issue should be fixed by providing setting.
relative links in markdown works in Github. however relref shortcode is not very good solution, if the documents should also be used in github.

Was this page helpful?
0 / 5 - 0 ratings