Skip to content

Commit

Permalink
Ensure symbol links end with a slash
Browse files Browse the repository at this point in the history
This removes the need for extra redirects when hosting the data on
Cloudflare R2.

Changelog: fixed
  • Loading branch information
yorickpeterse committed Jun 30, 2024
1 parent 5dd926e commit 7fe2d31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/idoc/module_name.inko
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ModuleName {
}

fn symbol_link(name: String) -> String {
'${link}${name}'
'${link}${name}/'
}

fn link -> String {
Expand Down
2 changes: 1 addition & 1 deletion test/idoc/test_module_name.inko
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn pub tests(t: mut Tests) {
t.test('ModuleName.symbol_link', fn (t) {
let name = ModuleName.new('std.foo')

t.equal(name.symbol_link('A'), '/module/std/foo/A')
t.equal(name.symbol_link('A'), '/module/std/foo/A/')
})

t.test('ModuleName.link', fn (t) {
Expand Down
1 change: 1 addition & 0 deletions test/idoc/test_url.inko
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ fn pub tests(t: mut Tests) {
t.equal(relative_url(from: '/foo/bar', to: 'test.md'), '../test.md')
t.equal(relative_url(from: '/foo/bar', to: '../test.md'), '../../test.md')
t.equal(relative_url(from: '/foo/bar', to: 'foo'), '../foo')
t.equal(relative_url(from: '/foo/bar', to: 'foo/'), '../foo/')
})
}

0 comments on commit 7fe2d31

Please sign in to comment.