tauri-docs icon indicating copy to clipboard operation
tauri-docs copied to clipboard

fix: broken links by adding default append slashes to internal redirects

Open gabenddos opened this issue 1 year ago • 10 comments

What kind of changes does this PR include?

  • Minor content fixes (broken links, typos, etc.)

Description

  • Closes #2185
  • Only fixes links with missing append slashes.

For the dummy links like the /start/create-project/ that points to itself and not an actual link I fixed the redirect to prevent the error but also added a TODO so we can more easily track these dummy links in the future.

TL;DR: It was broken and a dummy link. Now it's just a dummy link with a TODO hint on the code = ) image

gabenddos avatar May 23 '24 03:05 gabenddos

Deploy Preview for tauri-v2 ready!

Built without sensitive environment variables

Name Link
Latest commit 88778fe24a51211fc4813b3df433ff003881c799
Latest deploy log https://app.netlify.com/sites/tauri-v2/deploys/664f5338d9bb6f00089b566b
Deploy Preview https://deploy-preview-2186--tauri-v2.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 23 '24 03:05 netlify[bot]

@simonhyll hi just fixed a toon of broken links in this, for content itself nothing should be changed = )

gabenddos avatar May 23 '24 04:05 gabenddos

eae, I can't seem to reproduce this issue, tried Firefox and Chrome. Could you elaborate?

vasfvitor avatar May 23 '24 04:05 vasfvitor

Shure, basically I was using the docs and I noticed that always I used a link that didn't have an append slash the redirect would break. When I was looking for more broken links I noticed a strange behavior that sometimes it would auto-complete the trailing slash and not break. But if I use the go back in the browser and try to access the same link again it breaks 100% of time.

I'll try to record a nimbus to show what I'm saying

gabenddos avatar May 23 '24 11:05 gabenddos

Here it is!

https://github.com/tauri-apps/tauri-docs/assets/36337762/ef281876-0f0f-4572-b9f4-f8f866dd2672

I'm sorry for the awful sounds, please mute the video, it's 6 AM in my timezone, just woke up, it's cold AF and I'm having terrible rhinitis 💀

gabenddos avatar May 23 '24 11:05 gabenddos

We had that issue in the v1 docs (or earlier v2 docs can't remember) a while back so i can at least confirm that this can be an issue x)

FabianLars avatar May 23 '24 11:05 FabianLars

As in the video above, I tried with Chrome and Safari and sometimes the trailing slash don't apply and the page breaks 😢 If it helps, I also noticed that the missing trailing slash does not cause any issues while running on localhost. That's why I think that the problem is also related to some deployment configurations like a NGINX conf or something like that.

@vasfvitor

gabenddos avatar May 23 '24 11:05 gabenddos

I've always removed trailing slashes from my work's docs site 😅

Rigidity avatar May 23 '24 12:05 Rigidity

Ideally we can make both variants behave the same... Can't find the conversations about the last time so idk what we did there.

FabianLars avatar May 23 '24 12:05 FabianLars

now I'm wondering if isn't there a linting setting that will do this automagically

I see no reason to not merge this once reviewed, would be a good idea to set config to always to enforce?

https://docs.astro.build/en/reference/configuration-reference/#trailingslash

plus, https://github.com/tauri-apps/tauri-docs/blob/v2/public/_redirects would need to be updated if so

vasfvitor avatar May 23 '24 14:05 vasfvitor

We can fix trailing slash management in a followup PR, the updates LGTM, shipping.

Thanks for the hard work!! ❤️

simonhyll avatar May 23 '24 17:05 simonhyll