Closed delan closed 1 month ago
option 1: use js to fix fragment links from #foo
to url#foo
option 2: opt-in fix with a {{ |url }}
filter
option 3: magic fix
url()
values (we don’t have this)http://host/path?query#fragment
→ don’t fix//host/path?query#fragment
→ don’t fix/path?query#fragment
→ do we fix this or not?path?query#fragment
→ do we fix this or not??query#fragment
→ how about this? (less important)#fragment
→ don’t fixif we go with a magic fix, what kinds of urls do we fix? say we have base_url = "/posts/"
…
if we fix this → then we link to this ↓ with |
/path/to/file only |
path/to/file only |
both |
---|---|---|---|
/posts/2.html |
/2.html |
2.html |
either |
/cats/diffie |
[../]../cats/diffie :(//host/cats/diffie :( |
/cats/diffie |
[../]../cats/diffie :(//host/cats/diffie :( |
/posts/tagged/cats.html |
/tagged/cats.html |
tagged/cats.html |
either |
if we fix /path/to/file
urls only…
attachments/...
urlscurrent url → link url ↓ |
/posts/1.html |
/posts/tagged/cats.html |
---|---|---|
2.html |
/posts/2.html \o/ |
/posts/tagged/2.html :( |
/2.html |
/posts/2.html \o/ |
/posts/2.html \o/ |
/cats/diffie |
/posts/cats/diffie :( |
/posts/cats/diffie :( |
if we fix path/to/file
urls only…
/
current url → link url ↓ |
/posts/1.html |
/posts/tagged/cats.html |
---|---|---|
2.html |
/posts/2.html \o/ |
/posts/2.html \o/ |
/2.html |
/2.html :( |
/2.html :( |
/cats/diffie |
/cats/diffie \o/ |
/cats/diffie \o/ |
if we fix both…
current url → link url ↓ |
/posts/1.html |
/posts/tagged/cats.html |
---|---|---|
2.html |
/posts/2.html \o/ |
/posts/2.html \o/ |
/2.html |
/posts/2.html \o/ |
/posts/2.html \o/ |
/cats/diffie |
/posts/cats/diffie :( |
/posts/cats/diffie :( |
you know your change is Good when it even “fixes” a couple of fucked up chosts :)
fixed in d14767d0fe1ab13e01ec827cecdc4348d7331fda through f5415d8312a7e096109448e33010f6ef5bb30d31; 4e484df4221efb980741d2299bbc4ce31bb9d936 unfortunately comes with a pretty big perf regression, but i’ve managed to reclaim most of the runtime in subsequent commits:
the threads page template uses <base href>, but this breaks fragment links in posts.
for example, say you’re in /posts/1.html and you have:
that becomes this, which may work but will navigate for no reason: