mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
org: Disable broken pretty relative links feature
go-org PrettyRelativeLinks rewrites relative org links by
- adding `../` in front
- removing any `.org` suffix
This was meant to play well with hugo pretty urls (which pretty much renders
posts in a subdirectory without the file suffix) and allow use of normal org
file links to reference other posts.
There's a lot of edge cases I didn't consider and multiple bug reports in
go-org [1] later I don't think the complexity of handling those edge cases is
worth it - so let's disable it.
[1]
- https://github.com/niklasfasching/go-org/issues/53
- 5dadf8c4c2
(comment)
- https://github.com/niklasfasching/go-org/issues/51
This commit is contained in:
parent
0cd55c66d3
commit
fa432b17b3
1 changed files with 0 additions and 1 deletions
|
@ -52,7 +52,6 @@ func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e
|
||||||
return afero.ReadFile(c.cfg.ContentFs, filename)
|
return afero.ReadFile(c.cfg.ContentFs, filename)
|
||||||
}
|
}
|
||||||
writer := org.NewHTMLWriter()
|
writer := org.NewHTMLWriter()
|
||||||
writer.PrettyRelativeLinks = !c.cfg.Cfg.GetBool("uglyURLs")
|
|
||||||
writer.HighlightCodeBlock = func(source, lang string, inline bool) string {
|
writer.HighlightCodeBlock = func(source, lang string, inline bool) string {
|
||||||
highlightedSource, err := c.cfg.Highlight(source, lang, "")
|
highlightedSource, err := c.cfg.Highlight(source, lang, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue