mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
deps: Update go-org to v1.4.0
- Add support for pretty urls [1]. Rewrite file links: 1. replace the `.org` extension with `/` (`/foo.org` -> `/foo/`) 2. prefix unrooted links with `../` as relative links start in the fake subdirectory `/foo/` rather than `/` - Fix case-sensitivity of org drawer `🔚` [1] https://gohugo.io/content-management/urls/#pretty-urls
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
4fdec67b11
commit
212e5e5542
@@ -52,6 +52,7 @@ 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 {
|
||||
|
@@ -17,6 +17,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/gohugoio/hugo/markup/converter"
|
||||
|
||||
@@ -25,7 +26,10 @@ import (
|
||||
|
||||
func TestConvert(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
p, err := Provider.New(converter.ProviderConfig{Logger: loggers.NewErrorLogger()})
|
||||
p, err := Provider.New(converter.ProviderConfig{
|
||||
Logger: loggers.NewErrorLogger(),
|
||||
Cfg: viper.New(),
|
||||
})
|
||||
c.Assert(err, qt.IsNil)
|
||||
conv, err := p.New(converter.DocumentContext{})
|
||||
c.Assert(err, qt.IsNil)
|
||||
|
Reference in New Issue
Block a user