Skip to content

Commit

Permalink
Fix links.
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Plotka <[email protected]>
  • Loading branch information
bwplotka committed May 18, 2021
1 parent 0b421ed commit b57b707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ func (r *relLinkTransformer) TransformDestination(ctx mdformatter.SourceContext,
} else {
// Because all links are normally files, in Hugo those are literally URL paths (kind of "dirs").
// This is why we need to add ../ to them.
// TODO(bwplotka): Allow customizing this behav on mdox.yaml?
newDest = filepath.Join("..", newDest)

// All slugs and paths are converted to lower case on hugo too, so do this too links.
newDest = strings.ToLower(newDest)
}

if len(split) > 1 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/transform/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestTransform(t *testing.T) {
tmpDir = "testdata/tmp"
testData = "testdata"
)
//defer func() { _ = os.RemoveAll(tmpDir) }()
defer func() { _ = os.RemoveAll(tmpDir) }()

logger := log.NewLogfmtLogger(os.Stdout)

Expand Down

0 comments on commit b57b707

Please sign in to comment.