Skip to content

Commit

Permalink
org: Disable broken pretty relative links feature
Browse files Browse the repository at this point in the history
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]
- niklasfasching/go-org#53
- niklasfasching/go-org@5dadf8c (comment)
- niklasfasching/go-org#51
  • Loading branch information
niklasfasching authored and bep committed Apr 12, 2021
1 parent 0cd55c6 commit fa432b1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion markup/org/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e
return afero.ReadFile(c.cfg.ContentFs, filename)
}
writer := org.NewHTMLWriter()
writer.PrettyRelativeLinks = !c.cfg.Cfg.GetBool("uglyURLs")
writer.HighlightCodeBlock = func(source, lang string, inline bool) string {
highlightedSource, err := c.cfg.Highlight(source, lang, "")
if err != nil {
Expand Down

0 comments on commit fa432b1

Please sign in to comment.